0

I have an office LAN 192.168.1.0/24 which has a general internet connection via Router1 which is the default gateway on our LAN.

I wish to add a second router/gateway which will route messages to a certain WAN IP via a private Ethernet connection (WAN side is 192.168.12.153/30).

What steps do I need to take to make this happen?

For one thing, I plan to add a second router, Router2, so the addresses would be:

  • Router2 LAN side 192.168.1.250/24
  • Router2 WAN side 192.168.12.154/30
  • Private WAN connection at Router2 192.168.12.153/30
  • WAN address to route over private connection 1.2.3.4

I assume I need to add some static routing information. What do I need? On which device do I need to add the static routes?

I have tried some routes but failed.

2

I think you can use two approaches:

  1. On your DHCP server for 192.168.1.0/24 subnet, use DHCP option 121 to push static route on your clients (with 1.2.3.4/32 as a network and 192.168.1.250 as a destination) and for devices with static IP addresses you have to create static persistent routes manually. // this is direct routing via Router2

or...

  1. On your Router1 add route to network 1.2.3.4/32 via 192.168.1.250 (ex. on linux use something like ip route add 1.2.3.4/32 via 192.168.1.250) // this will be still routed via Router1 at first but will go to the Router2 but be aware of existence of any colliding PREROUTING chain rules

I'm not sure if I properly understand that your destination is really 1.2.3.4 so alternatively use different destination so it correspond to real destination server or network). If there are some more specific needs and contrarily non-specific destination, you should consider using some NAT rules.

  • 1
    I would add to your point 2, the router must support to send ICMP REDIRECT, not all router do. That way the router1 send back to the computer the correct route, thus any futur traffic go directly to the router2 after. (I prefer that way as it's central, it work even to non dhcp client) – yagmoth555 Aug 15 '18 at 12:15
0

You just need to add a route

ip route add 1.2.3.4/32 via 192.168.1.250
  • Should I add that to my default gateway (Router1)? – Dizzley Aug 15 '18 at 11:18
  • You should add it to your default gateway if the default gateway can reach that address and the answers come back to the default gateway. – RalfFriedl Aug 15 '18 at 11:34

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.