WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Help creating virtual networks of domU guests

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Help creating virtual networks of domU guests
From: Ernst Bachmann <e.bachmann@xxxxxxxx>
Date: Mon, 18 Jul 2005 09:28:06 +0200
Delivery-date: Mon, 18 Jul 2005 07:26:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20050718012530.90462.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <20050718012530.90462.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.1
On Monday 18 July 2005 03:25, David Richardson wrote:
> Hey guys,
> I'm still having problems getting this to work
> correctly.  Maybe I should be more clear in my setup.
> I only have 1 nic, eth0.  My dom0 gets its IP address
> from a dhcp server on eth0.  However, the dhcp server
> always gives me the same IP address based on my MAC
> address.  As such, my domU guests are unable to use
> this dhcp server to obtain IPs. 

Simply assign a different MAC address to your domU.
You can run with standard bridging, don't need alias devices and whatnot.
For the DHCP Server it looks like a second computer with different MAC is 
behind an ethernet bridge, so it'll assign a different IP to it.

> Therefore, what I 
> want to do (I think...) is to create a vpn of domU
> guests that bridge to a virtual interface eth0:1 in
> dom0. 

Bridging only accepts real interfaces AFAIK. After all, virtual eth0:1 style 
interfaces are just alias IP adresses, and the bridge works on ethernet level 
and doesn't care about IP at all.

> Outside traffic can then be routed between the 
> real eth0 and the virtual eth0:1 to reach the domU
> guests.  Then, I can run a dhcp server in dom0 for
> eth0:1 to assign made-up addresses to the domU guests
> when they boot.

with VPN you mean NAT?

> I've never done anything like this before, so any help
> would be great.  My first attempts have started out by
> doing the following:
>
> Create the virtual ethernet interface:
> #ifconfig eth0:1 192.168.1.1 netmask 255.255.255.0
>
> Create a bridge in dom0, attach it to eth0:1:
> #brctl addbr xen-br1
> #brctl stp xen-br1 off
> #brctl setfd xen-br1 0
> #ip link set xen-br1 up
> #brctl addif xen-br1 eth0:1

More like:
# no eth0:1 iface!

brctl addbr xen-br1
brctl stp xen-br1 off
brctl setfd xen-br1 0
# no brctl addif!
ifconfig xen-br1 192.168.1.1 netmask 255.255.255.0 up
# connect  domUs to xen-br1
# set "192.168.1.1" as default route inside domU

#setup NAT in dom0:
iptables -t nat -I POSTROUTING -i xen-br1 -j SNAT --to <insert IP of eth0 
here>
...
(the nat rules will need more work, maybe your distribution comes with premade 
scripts there)

/Ernst

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users