[pve-devel] [PATCH container 2/3] debian: always include the 'dev' portion in explicit routes

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Apr 25 16:20:42 CEST 2016


This should be safer (and would have fixed the link-local
case for debian, too).
---
 src/PVE/LXC/Setup/Debian.pm                         | 4 ++--
 src/test/test-debian-012/etc/network/interfaces.exp | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/PVE/LXC/Setup/Debian.pm b/src/PVE/LXC/Setup/Debian.pm
index 299e2d5..21bced5 100644
--- a/src/PVE/LXC/Setup/Debian.pm
+++ b/src/PVE/LXC/Setup/Debian.pm
@@ -113,8 +113,8 @@ sub make_gateway_scripts {
     my ($ifname, $gw) = @_;
     return <<"SCRIPTS";
 \tpost-up ip route add $gw dev $ifname
-\tpost-up ip route add default via $gw
-\tpre-down ip route del default via $gw
+\tpost-up ip route add default via $gw dev $ifname
+\tpre-down ip route del default via $gw dev $ifname
 \tpre-down ip route del $gw dev $ifname
 SCRIPTS
 }
diff --git a/src/test/test-debian-012/etc/network/interfaces.exp b/src/test/test-debian-012/etc/network/interfaces.exp
index c9725aa..4ce4e16 100644
--- a/src/test/test-debian-012/etc/network/interfaces.exp
+++ b/src/test/test-debian-012/etc/network/interfaces.exp
@@ -6,8 +6,8 @@ iface eth0 inet static
 	address 10.0.0.100
 	netmask 255.255.255.255
 	post-up ip route add 11.0.0.1 dev eth0
-	post-up ip route add default via 11.0.0.1
-	pre-down ip route del default via 11.0.0.1
+	post-up ip route add default via 11.0.0.1 dev eth0
+	pre-down ip route del default via 11.0.0.1 dev eth0
 	pre-down ip route del 11.0.0.1 dev eth0
 
 auto eth1
@@ -15,8 +15,8 @@ iface eth1 inet6 static
 	address fc00::1
 	netmask 64
 	post-up ip route add fc00:1::ff dev eth1
-	post-up ip route add default via fc00:1::ff
-	pre-down ip route del default via fc00:1::ff
+	post-up ip route add default via fc00:1::ff dev eth1
+	pre-down ip route del default via fc00:1::ff dev eth1
 	pre-down ip route del fc00:1::ff dev eth1
 
 auto eth2
-- 
2.1.4





More information about the pve-devel mailing list