I want to add a route permanently.
route add -net @ip netmask mask gw "gw" but every time when I shut down, I have to re-enter the command.
How can I make this route permanently?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
You set static routes in
An example entry would be
auto eth0 allow-hotplug eth0 iface eth0 inet static address 10.70.201.5 netmask 255.255.255.192 ### Ubuntu Linux add persistent route command ### post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.70.201.6
This sets a static address and mask and finally adds a static route.
Just add that command to
It's pretty simple, just run this command:
sudo echo "route add -net @ip netmask mask gw \"gw\"" >> /etc/rc.local.
Any commands in
/etc/rc.local are automatically run towards the end of the boot process, though when you install a fresh, Ubuntu-proper installation it shouldn't have anything in it.