0

I have the following configuration: my laptop connected to router #1 (ASUS RT-N66U, let call him R1) using wireless connection. Laptop's IPv4 address is 192.168.1.143 (DHCP allocated) (LAN options on R1: addresses: 192.168.1.1-192.168.1.254, mask: 255.255.255.0). My router #2 (ASUS RT-N10U, let call him R2) connected to R1 using wired connection. R2 LAN settings is: addresses: 192.168.2.1-192.168.2.254, mask: 255.255.255.0. My device (let call him D1) connected to R2 using wired connection and has IPv4 address 192.168.2.20. Lets try to draw the picture:

                                                     D1 192.168.2.20 (static)
                                                     |
                                                     | 192.168.2.x subnet
laptop 192.168.1.143 (DHCP)      R2------------------
   |  192.168.1.x subnet         |
   |                             |
   --------------R1--------------

I want to be able to access my laptop from D1 and vice versa (access D1 from my laptop), so for example D1 can connect to the web server running on the laptop. I'm not the guru in the network architecture, so I can figure out why I can't access my laptop from 192.168.2.x subnet (and can't access D1 from my laptop) and how can I achieve this.

Basically I need my laptop to be in one subnet (e.g. 192.168.1.x) and my device D1 be in other subnet (e.g. 192.168.2.x) so that D1 can access my laptop's web server.

Thanks in advance.

2
  • 1
    Which ports on both routers does the cable between R1 and R2 connect? Dec 17, 2013 at 14:43
  • @MarcksThomas: WAN port of R1 connected with external network. LAN port #1 of the R1 connected to WAN port of the R2.
    – maverik
    Dec 17, 2013 at 14:45

2 Answers 2

2

If you want to maintain two seperate networks, the most obvious subnets would be 192.168.1.0/24 and 192.168.2.0/24 for the networks behind R1 and R2 respectively. Currently, the latter is set to 192.168.0.0/16. That range includes all IP-addresses from the first subnet. When you attempt to access your laptop at 192.168.1.143 from D1, your packets will not be routed to their destination, because the IP is expected to be within the LAN. Limit the second subnet to 192.168.2.0/24 by changing the subnet mask to 255.255.255.0 and re-obtain IP-settings through DHCP. The destination IP 192.168.1.143 will no longer be within the current subnet and should be routed appropriately.

With this network setup, it will still be difficult to initiate a connection to D1 from your laptop. Network address translation will prevent access to hosts behind R2. To get around this, you would have to forward ports and connect to the WAN IP of R2 instead of 192.168.2.20.

2
  • What is meant here when you put the "/24" and "/16" on the IP addresses? I'm a networking dummy, so I need this spelled out a little more. Thanks.
    – jp2code
    Jul 6, 2016 at 14:00
  • 1
    @jp2code: It's shorthand for a range of addresses. For example, 192.168.1.0/24 refers to all addresses of which the first 24 bits (out of 32) match that of 192.168.1.0. The remaining 8 bits need not match, this leaves 2^8 addresses, between 192.168.1.0 and 192.168.1.255. It's equivalent to a subnet mask of 24 ones followed by 8 zeroes, i.e. 255.255.255.0. Jul 6, 2016 at 22:43
0

You should change your R1 subnet mask to 255.255.252.0 (or 255.255.0.0 to match what you have on R2).

2
  • Sorry, my fault, both routers have 255.255.255.0 mask. I've edited the question to fix that.
    – maverik
    Dec 17, 2013 at 15:00
  • I wish I could comment, but like you said, I don't have enough rep.
    – shinjijai
    Dec 17, 2013 at 17:50

You must log in to answer this question.

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