In Ubuntu, permanent static routes also called as Persistent routes are the static route entries that will not be deleted when the network restart or when the system restart. Typically in a Linux System, route add and ip route add commands are used to add static routes to the routing table.

In Linux, static route can be added and delete using “route” command. But the drawback is when linux server is rebooted, it will forget the static routes configuration. To avoid network interruption on the linux server, you can configure static route to take effect immediately without rebooting and also should apply after the next reboot. Jan 13, 2019 · Now I am going to add one static route where we can define Network as well as specify via which IP address and interface the packet should travel through in order to reach its destination. For example, let’s add a static route to destination network 10.10.20.0/24 via 192.168.43.15 ip address and enp0s3 interface. In the case of static routes that [1/0] the 0 is just a place holder a value given to a field that is never checked. It cannot be modified by configuration. To be noted when a static route specifies an outgoing interface instead of an IP next-hop it can have AD 0 like a connected route. Jun 16, 2010 · Yeah, that is how you setup your default gw, but in order to setup a static route you need more information than that. I honestly don't think you can put a static route definition in there. I suspect the script that sources that file is only looking for the information you listed.

To add a default route run below ‘ip route add’ command, $ sudo ip route add default via dev interface. For example: $ sudo ip route add default via 192.168.43.1 dev eth0. We hope that this tutorial was informative and provided you with insights into how you can go about adding and deleting static route in Linux.

Adding a Static route in Debain Linux can be done using the "route" command and editing the network script files. Advantage of using the route command is that it alters the Kernel IP Routing table dynamically and the static route becomes available as soon as it is been added. However, a reboot of the server looses this static route.

Nov 08, 2012 · The first command is the old traditional route add and second is the IP route command. Earlier we learned how to route add in Linux, in this tutorial, here I will show you how to add permanent static routes in Linux distributions such as Centos and Ubuntu. Adding temporary static routes

Dec 19, 2018 · The drawback of ‘ip’ or ‘route’ command is that when Linux system reboots it will forget static routes. So store them in a configuration file. Static routing describes a system that does not implement adaptive routing. To do this, you need to add a static route. Add a temporary static route. If you wish to add one temporarily, simply run the ip route add command with the right network information: ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0. 172.16.5.0 is the network you wish to access. /24 is the subnet mask Jan 13, 2018 · We are going to talk about different ways to set static route.Both temporarily and setting up the permanent static route. Adding static route with route add command. The syntax is: route add -net / dev Let’s add a route for interface eth1, network 192.168.1.0/24. To add a default route run below ‘ip route add’ command, $ sudo ip route add default via dev interface. For example: $ sudo ip route add default via 192.168.43.1 dev eth0. We hope that this tutorial was informative and provided you with insights into how you can go about adding and deleting static route in Linux. Oct 06, 2018 · Add a static route on Linux. You must login as root user with the help of su command or sudo command: $ su - OR $ sudo -i Once become a root user, setup a temporary route using the ip command: # ip route add 172.10.1.0/24 via 10.0.0.100 dev eth0 Verify it: # ip r Here is another example where I am setting up route for my VPN gateway: