0

On Ubuntu 14.04.

I need to route the traffic to specific IP ranges though a specific interface.

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
169.254.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth3
169.254.51.0    0.0.0.0         255.255.255.0   U     0      0        0 eth4

I need the following:

169.254.1.0 - 169.254.1.254 => Route through "eth3"
169.254.51.0 - 169.254.51.254 => Route through "eth4"

Must also persist when server restarts.

Any help please?

  • Your routing table is set up correctly. This looks like the routes has been already set up by just adding the IPs from those subnets on correct interfaces. Perhaps there is a different issue with your setup? – Fox Apr 25 '15 at 18:21
  • When configuring an interface, a subnet route is added to the kernel routing table at the same time. There is no need to add any routes. – Tero Kilkanen Apr 26 '15 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.