Re: [Xen-users] domU network doesn''t get IP

Jayesh Salvi
Wed, 04 Jan 2006 05:29:56 -0000

Hi,
I resolved this issue. I could not get it working using network-bridge
script, but NAT worked.

So I changed the xend-config.sxp so that it would execute:
(network-script network-nat)
(vif-script     vif-nat)

Restarted xend, launched domU.

I found that this script uses dhcp and vif interface got an IP address when
seen from dom0. i.e. ''route -n'' from dom0 shows:
[root@orion ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
10.0.8.1        0.0.0.0         255.255.255.255 UH    0      0        0
vif8.0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
24.118.198.0    0.0.0.0         255.255.254.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         24.118.198.1    0.0.0.0         UG    0      0        0 eth0

And I can ping to 10.0.8.1  even though my domU doesn''t have its IP
yet.

When I booted domU however it did not get the IP address at boot time.
Determining IP information for eth0... failed.
[FAILED]

ifconfig showed eth0, but with now ip.
So I manually assigned IP to eth0 by running: ifconfig eth0 10.0.8.1 netmask
255.255.255.0
Further I added a route in the IP routing table:
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.8.1
So now my IP table looks like:
[root@localhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
10.0.8.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 lo
0.0.0.0         10.0.8.1        0.0.0.0         UG    0      0        0 eth0

Now I can ping to dom0 from domU, as well as I can ping to IPs of google and
yahoo. So now domU can see the world.

Interesting thing is, if I assign an IP of 10.0.8.20 to eth0 in domU and add
a route ''route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.8.1'',
that doesn''t
work. pings won''t work to dom0. I will figure that out later.

Thanks for all the suggestions.