2

What I want to do may be pretty simple but I'm not very experienced with networking. I'll use pictures to explain, this is my current setup:

enter image description here

I want to extend my network so that I can add more devices, but because of the physical disposition of my devices I can only do so in the port used by device B of my current setup.

enter image description here

Unfortunately I have services running on device B and I need to persist its LAN IP, which I suppose I can easily do by just forwarding the used ports from the newly added router to the device's new LAN IP?

My first question regarding this setup is is my above statement correct?

My second question is How can devices from the outer (first) network access devices on the inner network?

If device A tries to connect to device D for example, wouldn't looking up 192.168.1.5 fail because the outer router doesn't have such an address?

  • Routers route between networks, not from one network to the same network. What router model do you have? – Ron Maupin Dec 6 '16 at 22:38
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 15 '17 at 15:50
2

The second router can not have the same IP addresses (same subset) for both host and the other router. What you need is to replace the second router with a switch and your problem will be solved.

2

In your case, Babak is right, but didn't fully explain.

Are you sure you want a router for that operation? Have you considered using a switch instead?

Essentially, a router is designed to route between disparate networks. It's designed so that you can take network a and access it from network b, and vice-a-versa. The problem you are going to have is that the typical home routers use NAT (Network Address Translation) to allow multiple devices to use the router to connect through one public IP. The public IP for router 2 is going to be 192.168.1.3. This means that you cannot have any 192.168.1.x devices inside that network (assuming you used the default subnet mask of 255.255.255.0 for a class-C network everywhere, which is highly likely). So in this case, you have two options:

  1. Disable NAT. Not all home routers support this, but you can change the network for the inner devices to 192.168.2.0/24 for example, or change the outside network (since 192.168.1.3 is your service host) to the 192.168.2.0/24 network and make the inside network 192.168.1.0/24.
  2. Use a switch. I highly recommend this option. If you get a cheap switch (or use the switch ports on your router instead of the WAN/Internet port) you can extend your network seamlessly. The router at that point will only be performing switching operations, which allows you to not have to change IP schemes at all (and give router 2 an IP that is not 192.168.1.3). Basically, your router (assuming it's a SOHO router) should have one port and then a group of ports, usually separated by a small amount (1/4 to 1/2 inch). Plug everything into the group, nothing into the single. There is almost always no configuration required on the router to do this. Plug-and-play (in Windows 98/ME/2000/NT we called it "plug-and-pray", but I digress). DHCP will pass through the switch (if you use DHCP), and everyone can see each other as if there was nothing in the way. If it's a commercial grade router, then depending on modules installed (I.e. none of my Cisco routers have switch port modules) you may still have switch port modules on it (based on your diagram I think you do) but you may have to enable them. (A lot of routers, Cisco especially, come with all ports disabled, switches usually don't have this default.) It is also worth noting that if you are using the switch ports on your second router and not the router itself, you should consider (actually, you should just do it) disabling DHCP to avoid conflicts on the second router.

Personally, I would go for option 2. There's no need to segregate your networks like that (unless you want an additional firewall to device B, but you probably don't need it).

  • most "home routers" can be used as a switch/wireless access point. Just disable the DHCP server, set the routers lan IP to a non-conflicting address and don't connect anything to the WAN port. – Peter Green Dec 7 '16 at 19:17
  • @PeterGreen Aye, added a little more explanation regarding home routers and commercial routers. – Der Kommissar Dec 7 '16 at 19:22
  • Disabling the DHCP on the "router used as a switch" is not merely something you "should consider", it's vital to stop the new router handing out a wrong default gateway and potentially conflictly addresses. – Peter Green Dec 7 '16 at 19:39
  • @PeterGreen Not necessarily. You can configure DHCP to give out any gateway address and share a pool with the other router. (Ever heard of localized DHCP servers? We used them at a University I worked for.) – Der Kommissar Dec 7 '16 at 19:43
  • @PeterGreen In fact, in many cases, you would not even want the first router to be the DHCP server, and would instead setup the second router as the DHCP server, disabling it on the first router and statically assigning that IP address. This helps off-load work that the edge-router would be doing to a more specialized device. Whenever I set up networks I always set up the edge layer as a firewall -> router -> internal switch, then on that switch I have another device (whatever it may be) that is the DHCP server to make sure the firewall and router have specifically one task to perform. – Der Kommissar Dec 7 '16 at 19:52
0

TLDR: keep it simple and use a switch as Babak and EBrown have already suggested.

Using a SOHO router as a switch by disabling the DHCP service should work, however, might cause headaches later if it gets accidentally reset (not entirely unlikely if it's not on a UPS). You could end up with conflicting gateway IP, overlapping DHCP scopes, subnet with no internet connection, etc. These are not trivial to diagnose if you don't know what to look for.

Also, leaving the second DHCP server enabled on purpose might work for business class devices, however, it's probably not possible here b/c SOHO routers typically assign themselves as the gateway (and sometimes as the DNS server) without any option to change.

Save yourself future headaches with a small investment in a switch.

This should have been a comment, but not enough rep yet ;-)

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.