There are many ways to do this, however I will show the one I use most often.
When adding a route in Ubuntu/Linux you would normally just run this for instance:
However, when rebooting this route will not be active, this is way you need to add static routes.Code:$ route add -net 10.0.0.0 gw 10.2.5.1 netmask 255.0.0.0 dev eth0
Create a file called "static-route" in /etc/network/if-up.d
Now make the file look like this and change the example routing as you would require it:
Well there you go, you could now create multiple static routes in one simple file.Code:#!/bin/sh # Set static routes # # Below are examples of how it should look to add static routes. /sbin/route del -net default gw 10.2.5.1 netmask 0.0.0.0 dev eth0 /sbin/route add -net 10.0.0.0 gw 10.2.5.1 netmask 255.0.0.0 dev eth0













Reply With Quote






Bookmarks