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] domU not able to access external network

To: "ashutosh mehra" <mehra.ashutosh@xxxxxxxxx>
Subject: Re: [Xen-users] domU not able to access external network
From: Tej <bewith.tej@xxxxxxxxx>
Date: Thu, 18 Sep 2008 14:47:08 +0530
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 18 Sep 2008 02:17:48 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=iSEzLD5juGXZ2DOXaJFE7IbCYexlh82FDKZBOh+Mh0k=; b=bfblGsiUpNv9uwTAml1BX9nQip9vEbdOJhV1on7ytUeYwxJV1i5JuQs9BrAUdY2lg3 ld2othe4DEusLvwew2HV8DZH0JvTyvcJvNi3YJTRQwfe7M49GThRSM4TYQ+teI1wdsY4 mIpByPfuhRnAgS9CaIzju9aa5HxNGxBam23Z8=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=nJt4gj5IJoEWyxvo8lhh//7Fx5AASx0J+iYc1LnL81r6hMV8Tmt4GXMUfJ7RC3zj73 ocTIOmjJggyJMgl91pbwPDfi1utedVxXKwLwoF7twlQMVH2suz6mhtvUFpDDiEc3hKJg jkBvcGd/4vPhpPkF+3u3w/2G76b+MKzs2UxPo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <67f718cf0809171027k66992bdcv849c78372cc7184b@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <67f718cf0809130739s5e128cebv47c6f8c91f922554@xxxxxxxxxxxxxx> <f1c9d250809140910s4b399ebfwf43dd5267a31b60@xxxxxxxxxxxxxx> <67f718cf0809151127u4ce273f4p4a5c07a57dfe75f5@xxxxxxxxxxxxxx> <f1c9d250809160131l231fd130nba99ff6bca34f6f4@xxxxxxxxxxxxxx> <67f718cf0809171027k66992bdcv849c78372cc7184b@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On 9/17/08, ashutosh mehra <mehra.ashutosh@xxxxxxxxx> wrote:
> I am able to ping gateway from domU but still not able to ping external
> network.
> I tried adding dom0's IP as gw for domU and then enabled IP forwarding but
> still no result.

Try two things
1. Look at tcpdump in dom0 tcpdump -i peth0. Start a ping from domU to
gw. Now ping from domU to external network. Comapre the difference.

2. Add the masquerading rule in dom0, to see if it works.
   /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
see if it helps.


>
> Thanks,
> Ashutosh
>
> On Tue, Sep 16, 2008 at 2:01 PM, Tej <bewith.tej@xxxxxxxxx> wrote:
>
>> On 9/15/08, ashutosh mehra <mehra.ashutosh@xxxxxxxxx> wrote:
>> > Output of 'route -n':
>>
>> it should work.  Are you able to ping gw from domU?
>>
>> try making dom0 IP as gw for domU.
>> # route add default gw 123.237.221.140
>>
>> Now enable forwarding on dom0.
>> Now see if it is pinging external network.
>>
>> HTH
>>
>> > In domU:
>> > Kernel IP routing table
>> > Destination     Gateway         Genmask         Flags Metric Ref    Use
>> > Iface
>> > 123.237.216.0   0.0.0.0         255.255.248.0   U     0      0        0
>> eth0
>> > 0.0.0.0         123.237.216.1   0.0.0.0         UG    100    0        0
>> eth0
>> >
>> > In dom0:
>> > Kernel IP routing table
>> > Destination     Gateway         Genmask         Flags Metric Ref    Use
>> > Iface
>> > 123.237.216.0   0.0.0.0         255.255.248.0   U     0      0        0
>> eth0
>> > 0.0.0.0         123.237.216.1   0.0.0.0         UG    100    0        0
>> eth0
>> >
>> > Both are same.
>> > Enabling IP forwarding also does not work.
>> >
>> > Thanks,
>> > Ashutosh
>> >
>> > On Sun, Sep 14, 2008 at 9:40 PM, Tej <bewith.tej@xxxxxxxxx> wrote:
>> >
>> >> On Sat, Sep 13, 2008 at 8:09 PM, ashutosh mehra
>> >> <mehra.ashutosh@xxxxxxxxx> wrote:
>> >> > I have Xen 3.2 with ubuntu-hardy as dom0 and domU.
>> >> > domU and dom0 are able to ping each other. While dom0 is able to
>> access
>> >> > external network, domU fails to do so.
>> >> >
>> >> > This is my configuration file for domU:
>> >> > ************************************************8
>> >> > kernel      = '/boot/vmlinuz-2.6.24-19-xen'
>> >> > ramdisk     = '/boot/initrd.img-2.6.24-19-xen'
>> >> > memory      = '128'
>> >> > root        = '/dev/hda2 ro'
>> >> > disk        = [
>> >> >
>> >> > 'tap:aio:/home/xen/domains/xen1.hardy.com/swap.img,hda1,w',
>> >> >
>> >> > 'tap:aio:/home/xen/domains/xen1.hardy.com/disk.img,hda2,w',
>> >> >               ]
>> >> > name        = 'xen1.hardy.com'
>> >> > dhcp        = 'dhcp'
>> >> > vif         = [ 'mac=00:16:3E:7E:85:8A' ]
>> >> > on_poweroff = 'destroy'
>> >> > on_reboot   = 'restart'
>> >> > on_crash    = 'restart'
>> >> > extra = '2 console=xvc0'
>> >> > *******************************************
>> >> >
>> >> > This is the result of ifconfig on domU:
>> >> > *******************************************
>> >> > eth0      Link encap:Ethernet  HWaddr 00:16:3e:7e:85:8a
>> >> >           inet addr:123.237.221.140  Bcast:123.237.223.255
>> >> > Mask:255.255.248.0
>> >> >           inet6 addr: 2002:7bed:dd03:4:216:3eff:fe7e:858a/64
>> >> > Scope:Global
>> >> >           inet6 addr: 2002:7bed:d99f:4:216:3eff:fe7e:858a/64
>> >> > Scope:Global
>> >> >           inet6 addr: fec0::4:216:3eff:fe7e:858a/64 Scope:Site
>> >> >           inet6 addr: fec0::9:216:3eff:fe7e:858a/64 Scope:Site
>> >> >           inet6 addr: 2002:7bed:dbc8:9:216:3eff:fe7e:858a/64
>> >> > Scope:Global
>> >> >           inet6 addr: fe80::216:3eff:fe7e:858a/64 Scope:Link
>> >> >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>> >> >           RX packets:153833 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:339 errors:0 dropped:0 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:1000
>> >> >           RX bytes:44702020 (42.6 MB)  TX bytes:41663 (40.6 KB)
>> >> >
>> >> > lo        Link encap:Local Loopback
>> >> >           inet addr:127.0.0.1  Mask:255.0.0.0
>> >> >           inet6 addr: ::1/128 Scope:Host
>> >> >           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>> >> >           RX packets:4 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:0
>> >> >           RX bytes:936 (936.0 B)  TX bytes:936 (936.0 B)
>> >> > *******************************************
>> >> >
>> >> > This is result of ifconfig on dom0:
>> >> > *******************************************
>> >> > eth0      Link encap:Ethernet  HWaddr 00:17:08:2e:f0:38
>> >> >           inet addr:123.237.218.27  Bcast:123.237.223.255
>> >> > Mask:255.255.248.0
>> >> >           inet6 addr: 2002:7bed:dd03:4:217:8ff:fe2e:f038/64
>> Scope:Global
>> >> >           inet6 addr: 2002:7bed:d99f:4:217:8ff:fe2e:f038/64
>> Scope:Global
>> >> >           inet6 addr: fec0::4:217:8ff:fe2e:f038/64 Scope:Site
>> >> >           inet6 addr: fec0::9:217:8ff:fe2e:f038/64 Scope:Site
>> >> >           inet6 addr: 2002:7bed:dbc8:9:217:8ff:fe2e:f038/64
>> Scope:Global
>> >> >           inet6 addr: fe80::217:8ff:fe2e:f038/64 Scope:Link
>> >> >           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>> >> >           RX packets:100339 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:6026 errors:0 dropped:0 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:0
>> >> >           RX bytes:13079829 (12.4 MB)  TX bytes:1102556 (1.0 MB)
>> >> >
>> >> > lo        Link encap:Local Loopback
>> >> >           inet addr:127.0.0.1  Mask:255.0.0.0
>> >> >           inet6 addr: ::1/128 Scope:Host
>> >> >           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>> >> >           RX packets:88 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:0
>> >> >           RX bytes:4400 (4.2 KB)  TX bytes:4400 (4.2 KB)
>> >> >
>> >> > peth0     Link encap:Ethernet  HWaddr 00:17:08:2e:f0:38
>> >> >           inet6 addr: fe80::217:8ff:fe2e:f038/64 Scope:Link
>> >> >           UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
>> >> >           RX packets:180678 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:5976 errors:0 dropped:0 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:1000
>> >> >           RX bytes:57972238 (55.2 MB)  TX bytes:1117217 (1.0 MB)
>> >> >           Interrupt:16
>> >> >
>> >> > vif1.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff
>> >> >           inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
>> >> >           UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
>> >> >           RX packets:341 errors:0 dropped:0 overruns:0 frame:0
>> >> >           TX packets:156172 errors:0 dropped:466 overruns:0 carrier:0
>> >> >           collisions:0 txqueuelen:32
>> >> >           RX bytes:36973 (36.1 KB)  TX bytes:45273041 (43.1 MB)
>> >> > *******************************************
>> >> >
>> >> > 'brctl show' displays:
>> >> >
>> >> > bridge name    bridge id        STP enabled    interfaces
>> >> > eth0        8000.0017082ef038    no        peth0
>> >> >                             vif1.0
>> >> >
>> >> > Should the MAC address of eth0 in domU and dom0 be same?
>> >> > Do I need to make any changes in configuration file?
>> >>
>> >> can you provide the 'route -n' command output on domU and dom0.
>> >>
>> >> try once by enabling IP forwarding on dom0
>> >> echo 1 > /proc/sys/net/ipv4/ip_forward
>> >>
>> >> HTH
>> >>
>> >> >
>> >> > Thanks,
>> >> > Ashutosh
>> >> >
>> >> > _______________________________________________
>> >> > Xen-users mailing list
>> >> > Xen-users@xxxxxxxxxxxxxxxxxxx
>> >> > http://lists.xensource.com/xen-users
>> >> >
>> >>
>> >
>>
>

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