0

I need help on how to route traffic from Router A to Router B.

Router A has a subnet for users on 10.10.32.0/24 that needs to send traffic to Router B which has a subnet of 10.20.64.0/22.

Users behind Router B do not have access to Router A network.

On Router A I have the following configuration options:

Destination IP / Mask:
Gateway:
Interface:

The destination IP / Mask would be the 10.20.64.0/22 of Router B?

The interface would be the 10.10.32.1?

And finally, what would the gateway be?

  • 4
    Can you supply a network diagram with the IP addresses of the various interfaces and the model/make of equipment? This information given is extremely confusing and incoherent, it is impossible to formulate an answer with the given information. – acejavelin Aug 2 '18 at 19:49
  • Router B is a SonicWall TZ 205 – MikeyPizza1 Aug 2 '18 at 20:41
2

Usually you don't send traffic "from Router A to Router B" to connect subnets. Instead, you set up a single router that is connected to both subnets. This router can forward packets between both subnets (which is the original definition of "router").

As such, the router has not "gateways" (which is a typical client configuration, where the gatway points to the router). Instead, it has routes for both subnets. Also, all clients in both subnets must have correct routes (unless this router is the default route for all clients).

You certainly can use two routers to connect two subnets, connecting only the routers to each other, but it's unnecessarily complicated.

Note that "home routers" can in principle do all of this, but their firmware is often only tailored to connect a single subnet to an ISP. You can flash most home routers with open source firmware like OpenWRT, however, so you can set up the subnets properly.

Edit

If you are using business class routers, you shouldn't have trouble setting the routing table.

As I wrote, the correct configuration is to use a single router X to route between both segments:

       10.10.32.0/24      Gateway         10.20.64.0/22
                             |
            |             +++++++              |
            |             +     +              |
            | ............+  X  +............. | 
            | 10.10.32.1  +     + 10.20.64.1   |
            |             +++++++              |
            |                                  |

This means each segment can set X as default gateway, and all is simple and easy. This even works if the /24 and the /22 net should get different gateways (which then both connect up to X).

If you insist on making things complicated, here you go: If A is the default gateway for one segment, and B for the other, then as soon as you use e.g. A to to connect them

       10.10.32.0/24      Gateway 1        10.20.64.0/22
                             |
            |             +++++++              |
            |             +     +              |
            | ............+  A  +............. | 
            | 10.10.32.1  +     + 10.20.64.2   |
            |             +++++++              |
            |                                  |
            |                                  |
            |             +++++++              |
            |             +     +              |
            |             +  B  +............. | 
            |             +     + 10.20.64.1   |
            |             +++++++              |
                             |
                          Gateway 2

then the 10.20.64.0/22 segment (i.e., every single host on it) now needs two routes: One default route to B, and one route for 10.10.32.0/24 via 10.20.64.2 to A. This means you either get to install static routes on all hosts on the /22 segment, or you have to distribute routes via DHCP (and pray all hosts accept them).

Or, if you just give B a static route, it will mean every packet has to travel twice through the segment, halving bandwidth. ICMP REDIRECT messages may (or may not) alleviate this, depending on the OS's in use.

You can also make it complicated by connecting the routers between themselves:

       10.10.32.0/24      Gateway 1        10.20.64.0/22
                             |
            |             +++++++              |
            |             +     +              |
            | ............+  A  +              | 
            | 10.10.32.1  +     +              |
            |             +++++++              |
            |                | 192.168.1.3     |
            |                |                 |
            |    192.168.1.2 |                 |
            |             +++++++              |
            |             +     +              |
            |             +  B  +............. | 
            |             +     + 10.20.64.1   |
            |             +++++++              |
                             |
                          Gateway 2

This means you have a third segment with its own IP range. Now static routes on A and B suffice.

Are you sure you want one of the complicated configurations? What are your reasons for wanting it?

Users behind Router B do not have access to Router A network.

This doesn't affect routing: For a proper connection, packets have to go both ways. What you need to enforce this are firewall rules, depending on what organization you end up with. Which is a completely different subject.

TL;DR: If you want to route, you need routing tables. "What are the gateway, mask and interface settings?" means you haven't understood the problem. Figure out where to set routes on your routers.

  • I realized that. So I have Router A configured and I believe to have Router B configured. What I did was on Router A used 10.20.64.0/22 for Destination, I used 10.10.32.2 for Gateway, and 10.10.32.1 as Interface. Then for Router B, I assigned an interface with IP 10.10.32.2/255.255.255.0. However, i'm unable to ping from Router A to Router B. – MikeyPizza1 Aug 3 '18 at 0:27
  • You can "configure routers with gateways" until you are blue in the face, you won't get it to work this way. And I described why (home routers have a configuration interface for a single purpose, which doesn't match your purpose) and what needs to be done. Proper networking is different from what a home router is normally used for. – dirkt Aug 3 '18 at 2:39
  • And if the question is only about subnetting: If you insist on doing it the complicated way and connect router A and router B, you have a new subnet between router A and router B, which needs it's own range. You still need a way to set up routing tables on both routers. – dirkt Aug 3 '18 at 3:37
  • This is not a consumer router. Both routers are business class. – MikeyPizza1 Aug 3 '18 at 14:25

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.