Home » Virtualization » Setup Private Network on XenServer.

Setup Private Network on XenServer.

If you want to setup private network on xenserver and you only have one public IP that is set on interface xenbr0 interface (bridged from eth0) in sequence to make VMs to access the Internet we had to add an alias interface, as below :

#ifconfig xenbr0:0 netmask up

We consider our private LAN from where the VMs will get IPs. Furthermore we route all traffic from to xenbr0 using :

#ip addr add dev xenbr0

Now we have to add an VM and set an IP from the range.

#iptables -t nat -A POSTROUTING -s -j MASQUERADE
#iptables -I RH-Firewall-1-INPUT -s -j ACCEPT
#service iptables save

Then edit/modify /etc/sysctl.conf and enable ip_forward as below.

net.ipv4.ip_forward = 0

Change to

net.ipv4.ip_forward = 1

That’s it.


I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *


Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud