added gateway to lxc's /etc/network/interfaces
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 15 Jun 2009 20:22:04 +0000 (20:22 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 15 Jun 2009 20:22:04 +0000 (20:22 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@111 191e9f34-6774-4a6d-acfc-7664dacd4a2a

recepies/lxc/ve2lxc.sh

index 82e1154..702619c 100755 (executable)
@@ -5,7 +5,8 @@ test -z "$1" && echo "usage: $0 /path/to/ve/private [10.60.0.253]" && exit
 dir=$1
 hostname=ve2lxc
 ip=$2
-netmask=255.255.254.0
+netmask=`grep netmask /etc/network/interfaces | head -1 | sed 's/^.*netmask *//'`
+gateway=`grep gateway /etc/network/interfaces | head -1 | sed 's/^.*gateway *//'`
 
 test -z "$ip" && ip=10.60.0.253
 
@@ -45,6 +46,7 @@ iface lo inet loopback
 iface eth0 inet static
        address $ip
        netmask $netmask
+       gateway $gateway
 
 __interfaces__