[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Networking problem: "routing" from domUs through dom0


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Jiaqi Tan" <jiaqi.tan@xxxxxxxxx>
  • Date: Mon, 8 Oct 2007 17:59:31 -0400
  • Cc: jiaqi.tan@xxxxxxxxx
  • Delivery-date: Mon, 08 Oct 2007 15:00:21 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=sGGyNq5FokdKnBJE11xwKUOsDYoTE8R0It/EFWaA3bXAHfZomy5ivj9u4XRHX+UPeG8LDo50IW6Dgq4bwGfFxuQYhM2t3KgChJ+xwcGreRDICtwVvjfSOSfovAGSesm+tYNA/zHcVRpAP/6JHb7dtqesTQkPTqbd7HA97kZ8Foo=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Hi,

I'm trying to get the following setup working: I have 2 physical
machines, both with Xen 3.1.0 running Fedora Core 6, and 2.6.18
kernels, both with 2 NICs each. 1 NIC on each machine is connected to
the Internet (eth0), and 1 NIC on each machine (eth1) is connected on
a private network. I have set up bridging using netdev=eth1 for the
domUs on each dom0. I want the domUs on both machines to have direct
access to each other, which works fine right now via the private
network on the 2nd NIC on each machine, and I also want to access the
Internet on each domU through dom0. I'm trying to do that using IP
masquerading on the dom0s.

Currently, my setup is as follows:
1. Each dom0 has network-bridge netdev=eth1
2. Each dom0 has the FORWARD chain set to ACCEPT, and additionally has
rules for each vif#.0 to allow forwarding (created by xend when I boot
the domUs):

Chain INPUT (policy ACCEPT 325 packets, 30149 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 2 packets, 168 bytes)
 pkts bytes target     prot opt in     out     source               destination
   16  4760 ACCEPT     all  --  any    any     anywhere             anywhere

Chain OUTPUT (policy ACCEPT 266 packets, 39670 bytes)
 pkts bytes target     prot opt in     out     source               destination

3. In the NAT table, I have:
Chain PREROUTING (policy ACCEPT 12 packets, 776 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 4 packets, 376 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 MASQUERADE  all  --  any    eth0    anywhere             anywhere

Chain OUTPUT (policy ACCEPT 2 packets, 208 bytes)
 pkts bytes target     prot opt in     out     source               destination

4. IPv4 forwarding is enabled as well:
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

5. eth1 on dom0 has 10.1.1.3/255.255.255.0, and eth0 on domU has
10.1.1.103/255.255.255.0. Routing tables look like:

dom0:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
<net of internet connection>     0.0.0.0         <netmask>   U     0
   0        0 eth0
0.0.0.0         <internet gateway>     0.0.0.0         UG    0      0
      0 eth0

domU:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         10.1.1.3        0.0.0.0         UG    0      0        0 eth0

Also, xenbr0 and peth1 have no IPs, and eth1 has 10.1.1.3/255.255.255.0.

I can ping both ways (ping the dom0 eth1 IP from domU, and the domU IP
from dom0).

But when I try to ping an external host from the domU, there's simply
no response. tcpdump shows the packet appearing on eth1, but not eth0.
When I do iptables -t nat -L -v, none of the packets matches the -o
eth0 -j MASQUERADE rule, but when I insert a rule for -o xenbr0, all
the packets are seen going out through xenbr0 and matching that rule.
All my packets are getting from domU to dom0, and it hits the FORWARD
and POSTROUTING chains, but the packets are all going out through
xenbr0 although xenbr0 is not even in the routing tables.

Any ideas?

Thanks in advance.

Jiaqi Tan

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.