I want to add static route in ubuntu eth1 interface. Eth1 interface is up and runnng. I could add static route using route add command. It is working. But it was not persistent after reboots. So I decided to add entry in /etc/network/interfaces.But I found only entry for loopback interface n this file. Eth1 was not found. If I simply add the command in that file it is not working. Please help me in this.
|
There are many solutions. Most of the solutions were not working for me.There was one solution which worked. You can install ifupdown-extra in ubuntu. Then go to /etc/network/network-routes. Here we can add our static route. The syntax is explained in network-routes file itself.Route added like this will persist reboots. |
|||
|
|
/sbin/route route add -net 172.16.59.0 netmask 255.255.255.0 gw 172.16.74.135 dev eth1to the/etc/rc.localfile to persist between reboot... – George Udosen Feb 20 '17 at 6:26sudo lshw | grep ethto get the name of your device... – George Udosen Feb 20 '17 at 6:33