How Do I Configure a Static Route for a Gateway on the Same Network

networkingrouting

I'm trying to configure a router to forward traffic to another router on the same network (so that I don't have to configure static routes on each other machine on the network).

Here's a simplistic diagram of the network.

Goal: I want to be able to contact station_d from station_a (without configuring a static route on station_a).

I attempted to create a static route on inet_gateway, like 192.168.3.0/24 10.0.0.5. When that is in place, I can contact station_d from inet_gateway. However, I cannot contact station_d from station_a. Attempts to contact station_d get routed out to the Internet.

It appears that inet_gateway doesn't know that it's supposed to route the traffic. The ping I send from station_a has the MAC address of inet_gateway in the ethernet header, but inet_gateway doesn't (appear to) forward the traffic to router_b.

If I configure a static route on station_a (exactly like the one I made on inet_gateway), station_a can contact station_d. I don't want to have to maintain static routes like this on all the stations on the network, though.

Is this kind of thing possible: to have a router "route" traffic through another router on the same network as the originator?

Additional Information
Here are the routing tables (IP addresses changed to match diagram and protect the innocent). The Internet traffic goes through 192.168.0.1/24.

(inet_gateway)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
10.0.0.0        *               255.255.0.0     U     0      0        0 eth2
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
192.168.3.0     10.0.0.5        255.255.255.0   UG    0      0        0 eth2

(router_b)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     *               255.255.255.0   U     0      0        0 ath0
10.0.0.0        *               255.255.0.0     U     0      0        0 br0
default         10.0.0.1        0.0.0.0         UG    0      0        0 br0

//Bridged Adapters//: This kind of bridging is the default for the Ubiquiti device I'm using. I didn't attempt to unbridge some of the adapters. I put the device into "router" mode, but it still has the adapters bridged. I'm not certain if I can change that. I think this is unrelated to the fundamental problem.

ICMP Redirection

This seems like what I need to get working. Thank you very much for all the advice.

I cannot get inet_gateway to send the ICMP redirects. I believe the device is configured to send them, but its behavior suggests that it believes that it doesn't know it should be sending the redirects.

Attempting a traceroute to station_d from station_a results in this:

> tracert -d 192.168.3.10
Tracing route to 192.168.3.10 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  10.0.0.1
  2     1 ms     7 ms     2 ms  192.168.0.1
  3    15 ms    15 ms    16 ms  10.30.0.1
  4    34 ms    37 ms    22 ms  216.229.64.249
  5    35 ms    32 ms    27 ms  216.229.80.185
  6    25 ms    50 ms    35 ms  10.92.1.38
  7    32 ms    30 ms    28 ms  10.92.1.86

I would conclude that inet_gateway (Ubiquiti EdgeMax) does not know if should be sending ICMP redirects.

Best Answer

Maybe you need to add gateways to your diagram

Assuming that station_a has the ip 10.0.0.10/16 with gateway 10.0.0.1/16 and this gateway is connected to Router_b 10.0.0.5/16 with internal 192.168.3.1/24 (so the network is 192.168.3.0/24)

you need to tell the (Inner_gateway) add a static route to 192.168.3.0 255.255.255.0 with next hop 10.0.0.5

and in router B nothing (since it is directly connected so it knows the network)

If the client's are windows use Pathping IP to see routes and tracert.