Monday, March 14, 2011

Creating a private Network in Xen


Scenario :

The Guests should be able to communicate on 192.168.x.x network with each other internally.
the Host has a public ip(10.x.x.x)  which can communicate to outside world, the ip's in LAN are in range 10.x.x.x.

Host- A  (10.x.x.x) -xenbr0
Guest A (192.168.10.2)  -xenbr1
Guest B (192.168.10.3) - xenbr1


Solution :

HOST-A changes

*) On Host-A change vm.cfg for /xen/vm1/vm.cfg <--- vm.cfg config file of GuestA.

VM1 - Guest A (192.168.10.2)  - xenbr1

#vi vm.cfg
vif = [ip=192.168.10.4,bridge=xenbr1']

#vif = ['ip=10.228.141.198,bridge=xenbr0','ip=192.168.10.4,bridge=xenbr1'] <==Commented line


*) On Host-A change vm.cfg for /xen/vm2/vm.cfg <--- vm.cfg config fie of GuestB.

VM2 - Guest B (192.168.10.3) - xenbr1

#vi vm.cfg
vif = [ip=192.168.10.3,bridge=xenbr1']

#vif = ['ip=10.228.141.202,bridge=xenbr0','ip=192.168.10.3,bridge=xenbr1'] <==Commenetd line


on Host A add IP address for xenbr1 :

#ifconfig xenbr1 192.168.10.2 netmask 255.255.255.0 up


Guest A / Guest B changes:

on both the guests:
Change Guest IP Address to 192.x.x.x , that you mentioned in vm.cfg file.

cat /etc/sysconfig/network-scripts/ifcfg-eth0

and restart the network.


Now you should be able to ping from Host to guest and vice versa on 192 series IP.















No comments:

Post a Comment