Hi, Within my local lan, I have a Centos box with 6 domU. What I would like to do is to be able to assign different public IP to each of these dom. Does anyone know how to do that? What do I need to do in my dom0 and in my local lan router to configure different ip for each domU? Thanks for your help. Pete _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Simon Hobson
2008-Dec-03 23:17 UTC
Re: [Xen-users] how to assign public IP for different dom
Pete Kay wrote:>Within my local lan, I have a Centos box with 6 domU. What I would >like to do is to be able to assign different public IP to each of >these dom. Does anyone know how to do that? What do I need to do >in my dom0 and in my local lan router to configure different ip for >each domU?Sorry, but my crystal ball is on the blink - you''ll have to specify what your problem is ! I can GUESS that your WAN router is doing NAT, and I can GUESS that you''ve actually got the public IPs assigned to you by your ISP. There really is nothing special to Xen here, all you need to do is configure your network in the same way you would configure a network of real machines, and configure your WAN router to do the inbound NAT mapping or routing as appropriate. One option is to configure your WAN router to route the traffic without doing NAT - and then configure each machine with a public IP. If you want the machines to be multihomed (ie have address on the internal network as well as the public network), then I believe as recently as this week there have been one or two threads here on how to configure multiple networks on the Xen host and guests. Or you can leave the NAT in place, configure each machine with an RFC1918 private address, and use a static NAT mapping in the router to forward traffic to the appropriate internal address. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello, It is very easy. There are 2 ways of doing it: Prelude: make sure your public IP points to the IP of your dom0. Way1: - In the domU config file, you put the public IP of the domU - in the domU, edit /etc/network/interfaces with the correct public IP and add a gateway Way2 (my preference): - using iptables, create a redirection rule based on IP. Using way2 is a bit more tedious as you need to create a rule for each port you want to make available over internet, but iptables gives you more control on the packets. I have participated in the following screencast: http://www.digiprof.fr/products/demarrer-la-virtualisation-avec-xen It walks you through all the steps of setting up a network on a Xen virtual machine, and there is a chapter about public IP assignment. It''s in french but you should be able to understand the steps that are anyway in english. If people are interested I can ask to have it translated to english too. Best regards, On Wed, Dec 3, 2008 at 3:36 PM, Pete Kay <petedao@gmail.com> wrote:> Hi, > > Within my local lan, I have a Centos box with 6 domU. What I would like to > do is to be able to assign different public IP to each of these dom. Does > anyone know how to do that? What do I need to do in my dom0 and in my local > lan router to configure different ip for each domU? > > Thanks for your help. > > Pete > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users