Xen Cloud Platform (XCP) – Assigning A VLAN An IP Address

image_pdfimage_print

Once you create VLAN’s on your XCP server you will find that the physical interface you used to be able to hit by an IP address no longer responds. This is because you have trunked the interface into multiple VLAN’s and need to assign IP’s to the VLAN interfaces rather than the physical interface.

In order to do this first remove the static IP from the physical interface if it was assigned one. Then do the following:

(Note this example uses eth1 as the physical interface the VLAN’s are assigned to.)

First lets check the settings on the VLAN interface you need to assign an IP to.

xe pif-param-list uuid=d14427c2-4940-0db1-7d96-f55434af319e

This should return a list of the VLAN interfaces parameters for VLAN201

uuid ( RO): d14427c2-4940-0db1-7d96-f55434af319e
                     device ( RO): eth1
                        MAC ( RO): fe:ff:ff:ff:ff:ff
                   physical ( RO): false
         currently-attached ( RO): true
                        MTU ( RO): 1500
                       VLAN ( RO): 201
             bond-master-of ( RO): 
              bond-slave-of ( RO): <not in database>
       tunnel-access-PIF-of ( RO): 
    tunnel-transport-PIF-of ( RO): 
                 management ( RO): false
               network-uuid ( RO): 85a9aba5-73ea-4008-0a28-395c96be30fd
         network-name-label ( RO): network201
                  host-uuid ( RO): e965ccec-1dcd-4e48-bbed-147a877fb94b
            host-name-label ( RO): xen1
      IP-configuration-mode ( RO): None
                         IP ( RO): 
                    netmask ( RO): 
                    gateway ( RO): 
                        DNS ( RO): 
                io_read_kbs ( RO): 0.345
               io_write_kbs ( RO): 0.000
                    carrier ( RO): false
                  vendor-id ( RO): 
                vendor-name ( RO): 
                  device-id ( RO): 
                device-name ( RO): 
                      speed ( RO): 0 Mbit/s
                     duplex ( RO): half
            disallow-unplug ( RW): false
               pci-bus-path ( RO): 
               other-config (MRW): 

Notice the following parameters are all empty:

      IP-configuration-mode ( RO): None
                         IP ( RO): 
                    netmask ( RO): 
                    gateway ( RO): 
                        DNS ( RO):
 

Lets assign an IP address to this VLAN:

xe pif-reconfigure-ip uuid=d14427c2-4940-0db1-7d96-f55434af319e \
mode=static IP=192.168.201.11 netmask=255.255.255.0 \
gateway=192.168.201.1 DNS=192.168.201.3

Now we can confirm the setting by listing the parameters again:

xe pif-param-list uuid=d14427c2-4940-0db1-7d96-f55434af319e

Which should show:

      IP-configuration-mode ( RO): Static
                         IP ( RO): 192.168.201.11
                    netmask ( RO): 255.255.255.0
                    gateway ( RO): 192.168.201.1
                        DNS ( RO): 192.168.201.3

Now try to ping the address it should respond again.

You can also set it to use DHCP instead of assigning a Static address by using

mode=dhcp