0

Is it possible to use a home router to interconnect two or more routers? After a mistake I had some devices on 192.168.1.0/24 and others on 192.168.10.0/24. Obviously they don't communicate, because I need a router to interconnect them. Is this correct? Can use a home router to get them communicate.

0

Most "home routers" are actually gateways not true routers. As such, residential gateways usually connect at most two networks (Internet and a LAN). Further, they incorporate a firewall between the two networks that usually blocks traffic flowing from the Internet-connected network to the LAN. In the purest form, a router doesn't block traffic at all...it just moves it from one network to another.

All that said, if your home router is among those that support multiple LAN interfaces with distinct IP subnetwork address, either via separate physical interfaces or virtual VLAN interfaces, then you can do what you want. Otherwise you'll need to seek an alternate solution.

While I've never done so myself, there are several open source packages that I believe can be used to re-flash the firmware on your router and add the capability you require. Examples include OpenWrt and Tomato. These may be a worthwhile option for you.

Obviously you could solve your problem by re-addressing the devices to be on the same subnetwork. If you're looking for a really unique alternative, you could change the subnet mask on all of your devices to be 255.255.0.0 which would enable them to communicate without changing their IP address. Be sure your router supports a 16-bit mask before doing this. (Clearly this is more work than even re-addressing all the devices!)

  • ugh. My answer covers some, but not all of the ground you have. I just realised, after posting, both something I didn't quite grok about my setup and somewhere I went wrong. – Journeyman Geek Feb 25 '18 at 1:09
  • 1
    Also openwrt is the alternative firmware of choice these days – Journeyman Geek Feb 25 '18 at 6:15
  • Wow wow wow! You opened my eyes! So, if I understood well... Internet and my internal Network are two separated network that the router put in connection. When packets are for the lan the arp protocol resolve destination. When packets are for the world there is a route for the wan interface. Right? – robyg72 Feb 25 '18 at 18:10
  • ARP is used no matter which interface a packet is transmitted on. I'm unsure what your last statement means. If a packet is destined for a network the router doesn't have a specific routing table entry for, then the default route is used. A residential gateway will only have a specific route for two networks: the LAN and the WAN (which is just another network like the LAN). Traffic destined for the Internet in general won't be destined for either of these networks, so the gateway will send it to its default route, which will be the IP address of the next-hop router on its WAN interface. – Twisty Impersonator Feb 25 '18 at 18:31
0

I've actually gotten this working - on an stock asus and a dlink running tomato. You basically need to set up static routes on either side. This is not the smart way to do it - you'd actually be able to trivially get away with a single network if you can turn off DHCP on the secondary, and connect them correctly - since wan's actually on a seperate vlan in many consumer routers, connect the main router to a normal port on the secondary.

If you actually want 2 different subnets... the setup below works

                                                  Asus
+---------+                                   +--------------+
|Internet +---------------------------------->+ Primary router
|         |                                   | 192.168.1.1  +------->Dumb Switch
+---------+                                   +--------------+          +
                                               255.255.255.0            |
                                                                        |
                                                                        |
                                                                        v
                                                                       Secondary router
                                                                       192.168.1.142

                                                                       10.0.0.1
                                                                       255.255.255.128

I have a network that looks something like this - with a main router on a 192.168.1.1 subnet and a second router on its own 10.0.0.1 subnet.

Now, I'd like to route between these networks - I've tried to set up a static route on my main router

enter image description here

The routing table on the secondary router (a dlink running tomato firmware) looks like

enter image description here

I also needed to set it to router, not gateway mode

The ethernet cable on the second router is on the wan interface. In theory I'd need a static route for the second router but this just works

  • Optimally, you might also want to make all of the devices in the 192.168.1.0/24 network aware of the 10.0.0.0/25 network by adding a static route to that network for each device. This way, packets do not need to be firstly sent to the primary router in order to get over the secondary router. – Jerry Hundric Feb 25 '18 at 6:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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