I live in a hostel room where I am given a wall ethernet socket and a subnet(unique IP addresses to choose from). If I connect my laptop through ethernet, I use an IP

But I needed to connect my mobile devices as well. So I bought up a router.

Now the problem is that I am getting an ip address Now my friend sitting in the next room with ip address can not ping my laptop or use a TCP server that I have hosted on my machine.

Is there a way by which I can get an IP(or manually enter ip) in the same subnet (172.31.74.*) instead of getting an IP of 192.168.0.* ? (Something like what a switch would do). If not, is there any alternative thing I can do to resolve the issue?

  • 1
    The proper term is “Access Point”, by the way.
    – Daniel B
    Sep 22, 2016 at 13:56

2 Answers 2


That your friend cannot directly communicate with you is normal in a default configuration. By using a router in front of your sole physical access, you created a natted local network, the same way as any ISP does. The ISP is simply the hostel here.

For that to work, you need to configure your router to do the Network and Port Address Translation (NAT/PAT) so that the IP of your router on the hostel network links to your local device.

In some routers, there is the "DMZ" option (for Demilitarized Zone) which basically is a NAT/PAT that redirect every request made to your router towards the local device. But if you just want the translation to work for one particular port, you'll need to input a specific NAT/PAT rule, of this sort:

External IP   | External port      >>    Internal IP   | Internal port | e.g. 80 for http   >> | 80 (the actual port of your server)

Your friend will need to input the external IP with the external port that you'll configure to access your local device.


The easiest way would be to configure Port Forwarding in the router to direct traffic going to your TCP server to the IP address assigned to your machine. You may also want to set a static IP address on your machine so it doesn't change (and break the port forward).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .