If you have been playing around with XenClient and the Synchronizer, you may have wondered how can I configure a static IP address for the XenClient Synchronizer.
It’s actually not that hard, and if you follow these steps as described below, the you should get this to work just fine!
Using the Command Line Interface (CLI)
Use any Unix editor like vi, and follow the steps below at the console as root:
- Edit the following file:
- Comment the below line with a # in the beginning of the line
#iface eth0 inet dhcp
- Add the lines below:
iface eth0 inet static
address <insert static IP here>
netmask <insert subnet mask here>
gateway <insert default gateway here>
- Save the file, and that should retain static IP upon subsequent reboots.
Without using the CLI
If you do not feel comfortable editing the file manually use the procedure below:
- log in to VM-Synchronizer as “root” with your password.
- Modify the IP address, mask, and gateway with proper values when you execute the script:
- Copy and paste the script below in a file called /tmp/net_static.sh
cat > /tmp/net_static.sh
cp /etc/network/interfaces /etc/network/interfaces.old
sed ‘s/iface eth0/#iface eth0/’ /etc/network/interfaces > /tmp/interfaces
echo auto eth0 >> /tmp/interfaces
echo please enter the IP address
echo address $ip >> /tmp/interfaces
echo please enter the subnet mask
echo netmask $mask >> /tmp/interfaces
echo please enter your gateway
echo gateway $gate >> /tmp/interfaces
mv /tmp/interfaces /etc/network
- Press Ctrl+d to save the script.
- Run the script:
- rm /tmp/net_static.sh