Networking of Xen VMs

From Notes_Wiki
Revision as of 08:09, 22 January 2019 by Saurabh (talk | contribs)

<yambe:breadcrumb self="Networking of Xen VMs">Xen|Xen</yambe:breadcrumb>

Networking of Xen VMS

Detailed information on networking of Xen VMs is available at lab on http://www.sbarjatiya.com/website/courses/2010/monsoon/system_and_resource_virtualization/labs/06-networking_of_xen_VMs.pdf

Official Xen documentation on Xen Networking is available at http://wiki.xensource.com/xenwiki/XenNetworking


Initialization process of xen networking

When system boots following process takes place to initialize Xen networking:

  1. Service 'network' starts first to give proper IP address to eth0 (or eth<n>) using DHCP or static addressing etc.
  2. Service 'libvirtd' starts to create 'virbr0' with private IP address range. This also modifies firewall rules for NAT or for forwarding traffic between normal network and virtual network. This may also enable IP forwarding.
  3. Service 'xend' starts and uses config file '/etc/xen/xend-config.sxp' to initialize networking using configuration line '(network-script network-bridge)'
  4. This calls script '/etc/xen/scripts/network-bridge' which sets up networking using following steps:
    1. It copies MAC address and IP information from eth0.
    2. It creates vif0.0 and veth0 virtual end-points
    3. It copies MAC address and IP address learned from eth0 to veth0
    4. It changes MAC address of eth0 to 'FE:FF:FF:FF:FF:FF'
    5. It renames eth0 to peth0
    6. It renames veth0 to eth0
    7. It creates bridge xenbr0
    8. It attaches both peth0 and vif0.0 to xenbr0
    9. The script may create another set of veth1, veth2, etc. connected to veth0.1, veth0.2 etc. respectively upto veth7 for other network connections to xen briges.

Note: *If we want to setup xen networking for some other interface like eth2 then we can use './network-bridge start eth2' to setup peth2, xenbr2, etc. and when we are done we can use './network-bridge stop eth2' to remove peth2, xenbr2 and restore eth2 to normal configuration.

  • Sometimes MAC address in such cases gets stuck to FE:FF:FF:FF:FF:FF and causes problems after reboot. To resolve that refer to Xen troubleshooting.


<yambe:breadcrumb self="Networking of Xen VMs">Xen|Xen</yambe:breadcrumb>