How to Configure Static IP on Citrix XenClient Synchronizer

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:

  1. Edit the following file:
    vi /etc/network/interfaces
  2. Comment the below line with a # in the beginning of the line
    #iface eth0 inet dhcp
  3. Add the lines below:

    auto etho
    iface eth0 inet static
    address <insert static IP here>
    netmask <insert subnet mask here>
    gateway <insert default gateway here>

  4. 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:

  1. log in to VM-Synchronizer as “root” with your password.
  2. Modify the IP address, mask, and gateway with proper values when you execute the script:
  3. Copy and paste the script below in a file called /tmp/net_static.sh

cat > /tmp/net_static.sh
#/bin/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
read ip
echo address $ip >> /tmp/interfaces
echo please enter the subnet mask
read mask
echo netmask $mask >> /tmp/interfaces
echo please enter your gateway
read gate
echo gateway $gate >> /tmp/interfaces

mv /tmp/interfaces /etc/network

  1. Press Ctrl+d to save the script.
  2. Run the script:
    sh /tmp/net_static.sh
  3. rm /tmp/net_static.sh