0

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 172.31.74.129.

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 192.168.0.101. Now my friend sitting in the next room with ip address 172.31.74.137 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
  • 1
    The proper term is “Access Point”, by the way.
    – Daniel B
    Sep 22 '16 at 13:56
1

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
172.31.74.129 | e.g. 80 for http   >>    192.168.0.101 | 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.

1

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.