From f6ef5690e7de6460ff060eaedc9166f9e7335803 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Wed, 26 Oct 2011 23:40:46 -0700 Subject: [PATCH] make vm net ip configurable --- tools/xen/build_domU.sh | 4 +++- tools/xen/templates/interfaces.in | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/xen/build_domU.sh b/tools/xen/build_domU.sh index 451d440..0cbeaec 100755 --- a/tools/xen/build_domU.sh +++ b/tools/xen/build_domU.sh @@ -17,7 +17,8 @@ GUEST_NAME=${GUEST_NAME:-ALLINONE} HOST_IP=${HOST_IP:-`ifconfig xenbr0 | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//"`} # Our nova host's network info -MGT_IP=${MGT_IP:-172.16.100.1} +VM_IP=${VM_IP:-10.255.255.255} # A host-only ip that let's the interface come up, otherwise unused +MGT_IP=${MGT_IP:-172.16.100.55} PUB_IP=${PUB_IP:-192.168.1.55} # Public network @@ -263,6 +264,7 @@ rm -f $XVA set_hostname $GUEST_NAME INTERFACES=$STAGING_DIR/etc/network/interfaces cp $TEMPLATES_DIR/interfaces.in $INTERFACES +sed -e "s,@ETH1_IP@,$VM_IP,g" -i $INTERFACES sed -e "s,@ETH1_NETMASK@,$VM_NETMASK,g" -i $INTERFACES sed -e "s,@ETH2_IP@,$MGT_IP,g" -i $INTERFACES sed -e "s,@ETH2_NETMASK@,$MGT_NETMASK,g" -i $INTERFACES diff --git a/tools/xen/templates/interfaces.in b/tools/xen/templates/interfaces.in index 8fa8840..49c3d68 100644 --- a/tools/xen/templates/interfaces.in +++ b/tools/xen/templates/interfaces.in @@ -6,10 +6,8 @@ iface eth0 inet dhcp auto eth1 iface eth1 inet static - # A host-only ip that let's the interface come up, otherwise unused - address 10.255.255.255 + address @ETH1_IP@ netmask @ETH1_NETMASK@ -up ifconfig eth1 up post-up ethtool -K eth1 tx off auto eth2