Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

It is currently Fri Jun 05, 2020 11:10 am

Message body:
Enter your message here, it may contain no more than 60000 characters. 

:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.

Topic review - Debian persistent static route - how to make a static route persistent across reboots
Author Message
Post subject: Debian persistent static route - how to make a static route persistent across reboots  |  Post Posted: Sat Jan 17, 2015 7:55 pm
Debian linux "man interfaces" explains some callbacks used before or after an interface is brought up/down. One of them is "post-up". Quote "man interfaces":
post-up command
Run command after bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured (even
though it has really been configured), prints an error message, and exits with status 0. This behavior may change in the future.

Interface configuration file in Debian is under "/etc/network/interfaces" so that's where we can add the persistent static route.

# Network interface for debian
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
        post-up ip ro add via

A static route in Linux, as in any other net system, has 3 main components: host, netmask and gateway.

The above "ip ro add via" command can also be added to "/etc/rc.local".

Debian list routing table:
# ip route
default via dev eth0  proto static  initcwnd 10 initrwnd 10 via dev eth0
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list

Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]