Can clients block their IP address, without anyone knowing? - c#

I am using a code to know the client ip, who is logged in to my website up to this it is working fine, but if the client blocks their ip then what I will get, will I get their ip, and actually is there any chance to block their ip in the internet connection?
Please help me, Thanks in advance

It is not possible to block an IP address from the webserver. Ultimately, the TCP/IP connection has to know the address of both ends that are communicating.
This doesn't mean that the IP address that you see on the server is actually the IP address of the client, any more than it means the IP address of the server is the IP address that the client actually tried to reach.
If the client machine is behind a proxy or NAT device, you will see the IP address of the proxy or whatever IP address the NAT device is using for the specific TCP/IP session.
You cannot assume that HTTP requests from the same IP address are associated with the same browser, machine or user.

No. There is no possibility..
If anybody want to access your website , should be need to internet connection..
To connect in internet , each connection unique IP address

You will get the IP but not necessarily the IP of the client machine. Some time firewall block the actual IP address of the machine and provide the same IP of the node inside the Firewall

Related

Not communicate with client when client on other machine

I make a TCP/IP server in C# and client too. TCP-server is broadcasting packets to clients.
But it only broadcast on local IP not on other computers/machines.
All computers on connected SN MP server. I also changed IP address in code from (127.0.0.0) to network IP address (SNMP server IP Address). I pinged others IP with my computer; it's working but not making a connection with my TCP-server that I have made in C#.
Can you help me in this scenario?
Can't give a proper answer without seeing some code, but for starters, you can check whether the port is blocked in firewall or something (try to allow incoming connections in firewall for the specific port (whitelist it) )

How to Access WCF Service Behind NAT

Here is my situation :
I have a WCF with TCP Binding Service behind NAT and I am not able
to reach it.
I can reach my service using BasicHttpBinding and Raw TCP Sockets.
At server side port forwarding is done.
What may cause this ?
My Network Topology: Picture Link
I'm not experienced with WCF and nettcpbinding but this could help.
Theoretically it is not possible because your service has a local IP address, corresponding to the LAN where it is attached, and not a public IP address. So it could not be reached from the Internet, outside the NAT. However, almost all NAT devices, maybe your router/Access Point, have a feature for "Port Forwarding". This feature allows you to define that all packets addressed to a specific port are forwarded to a specific machine within you LAN, with a private IP address.
This could be a solution for you if you can overcome two hinders:
1-I don't know how the node in the Internet will send a message to the callback server. If it uses the IP address from which it received the request, there is not problem. If it receives a callback-IP address, then you have to figure out how to find out the public IP address of you NAT (maybe router/Access Point) and send out that IP address.
2-Your service behind a NAT needs to open a client port, or ephemeral port, to communicate with the service outside the NAT. If the second sends the message to the client port from which it received the message, you have to find a way to determine the client port you want to open (must be the same you configured in port forwarding). Will it listen in port 808 by default?
I hope this helps.
Check with URI "net.tcp://0.0.0.0:8000", this will ensure that the service will accept connection from any inbound IP address. At server side, the IP address mentioned in the URI & address from which the connection is accepted differs so the server is dropping the connection.

need to store IP address, is Request.UserHostAddress ok to use?

In a website I need to store visitor's IP address for security logging. I m not sure about IP address and its details just have an idea there are different types of IP addresses like user, internet provider, LAN IP, WAN IP etc.
I am even not sure which IP address I should store in database for security I have searched and came to know about Request.UserHostAddress that it returns The IP address of the remote client.
Can you please guide and confirm if I am sotring correct IP and using correct code to retrive IP ?
Edit
I am not certain why IP address is stored but know just as a good practice to do it. My guess is IP need to be stored to identify user, just in case if something wrong happens, with stored IP address it can be traced out who did it or from what area this request came.
Is there some other use of IP, please direct me as well.
Cheers
IP stands for Internet Protocol, which is the protocol underlying HTTP, which is what clients use to connect to web servers. Every machine on an IP network has a unique IP address.
UserHostAddress is the correct property for identifying the client's IP address. It does not matter whether the client is coming from the LAN or WAN, nor does it matter who their internet provider is. Internet providers (and I'm simplifying here) help route traffic to your website, but don't actually participate as an endpoint; the ISP's servers will not show up in the UserHostAddress, only the actual client who initiates the connection, which is typically the user.
Note that I say typically. IP addresses can be spoofed, or they can be hidden behind a proxy (like TunnelBear) or other obfuscation system (like Tor). There's no way to guarantee that you have the "real" IP address of the "real" user, but the aforementioned property is the closest you're going to be able to get.

Getting ip address of local computer connected to proxy server

I am currently implementing a HTTP proxy server and i need to get the local computers' ip addresses connected to it. Note that I am not referring to the remote server's ip address and it's not an ASP.NET app but rather a desktop app. The user on a different computer will input the ip address and port number of the proxy server through a browser, say Mozilla Firefox for instance, and i really need to get the user's ip address.
I am looking everywhere over the internet and i can't find a decent solution. Any idea please?

Socket Communication C#- IP Address

I have a socket application which I can use in local network, at home.
I can make them communicate for example from 192.168.x.x to 192.168.y.y ip addresses.
What should I do if I want to use the application over internet, from a remote machine, not local. For example which ip addresses should I use if my friend who lives another country wants to access my application.
On the server end, the easiest way is to bind to all available addresses by using IPAddress.Any as the address. You'll need to give the client your public Internet address to connect to. If you're being a NAT, it might involve looking at your router for the address (or using http://www.whatismyip.com/) and configuring it to route the traffic to your PC.
You need to set up your router to forward the port that you wish to communicate on. Once you have that in place, give your friend your public IP address.
For instance, you can configure your router rules to point all port 80 requests to your 192.168.x.x machine, so that when ever a request for port 80 comes in, it automatically gets sent to a specific address on your subnet.
Your outgoing IP address. Use this site to see it: http://www.whatismyip.com/
And of cause port forward your router.
You will have to use the IP address provided by you ISP (internet service provider). Usually these IP addresses are non static, so that you need to provide some way to resolve your dynamic IP address to a static name (dyndns providers do this usually).
In addition you need to configure you router to forward the incomming traffic on port xxx to your local machine (this is usually not your router, except when you are using a modem). This is called port forwarding.

Categories