]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb
Disable udev generators
[dsa-puppet.git] / modules / ganeti2 / templates / instance-debootstrap / hooks / 00-dsa-configure-networking.erb
index 6878e13182d1bfb01249cf4d54fd04af11152d5c..9662aaff49d13729c849b922edd766b7c682d1e0 100755 (executable)
@@ -19,9 +19,11 @@ fi
 
 rm -f $TARGET/etc/udev/rules.d/70-persistent-net.rules
 
-if [ "$NIC_COUNT" -gt 0 ]; then
+touch $TARGET/etc/udev/rules.d/75-cd-aliases-generator.rules
+touch $TARGET/etc/udev/rules.d/75-persistent-net-generator.rules
 
-  cat > $TARGET/etc/network/interfaces <<EOF
+if [ "$NIC_COUNT" -ge 1 ]; then
+  cat > $TARGET/etc/network/interfaces << EOF
 # /etc/network/interfaces
 
 auto lo
@@ -33,10 +35,26 @@ iface eth0 inet static
   netmask 255.255.255.0
   gateway 206.12.19.254
 
+  pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true
+  up   ip addr add 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE
+  up   ip r add default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE
+  down ip r del default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE
+  down ip addr del 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE
 EOF
 
 fi
 
+if [ "$NIC_COUNT" -ge 2 ]; then
+  cat >> $TARGET/etc/network/interfaces << EOF
+auto eth1
+iface eth1 inet static
+  address ${NIC_0_IP}
+  netmask 255.255.255.0
+EOF
+
+fi
+
+
 cat > $TARGET/etc/resolv.conf <<EOF
 # /etc/resolv.conf
 search debprivate-ubc.debian.org debian.org
@@ -45,3 +63,5 @@ nameserver 206.12.19.21
 EOF
 
 exit 0
+
+# vim:set syn=sh: