From 12af86395ff3726789f72e96aa1367e2e428b972 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 10 Dec 2009 22:08:51 +0000 Subject: [PATCH] Allow ip to add the default route. Fixes #211. --- conf.d/network.Linux | 3 +++ init.d/network.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/conf.d/network.Linux b/conf.d/network.Linux index 1b6d1214..b945a7ba 100644 --- a/conf.d/network.Linux +++ b/conf.d/network.Linux @@ -3,6 +3,9 @@ # On the other hand, ip (iproute2) is quite powerful and is also supported #ip_eth0="192.168.0.10/24; 192.168.10.10/24" +# You can also use ip to add the default route. +#defaultiproute="192.168.0.1" + # ip doesn't handle MTU like ifconfig, but we can do it like so #ifup_eth0="ip link set \$int mtu 1500" diff --git a/init.d/network.in b/init.d/network.in index 7bbe2535..0d53f14d 100644 --- a/init.d/network.in +++ b/init.d/network.in @@ -255,6 +255,10 @@ start() route add default $defaultroute fi eend $? + elif [ -n "$defaultiproute" ]; then + ebegin "Setting default route $defauliptroute" + ip route add default via $defaultiproute + eend $? fi return 0