Hi, I using pv ubuntu as DomU and my xen is 4.0.0. I can boot the DomU successfully, but I can not access to internet in DomU. Event I ping the Dom0 and it show "Network is unreachable". So how can I access to internet in the pv domU and how can I ping the dom0 successfully? Some information is as following. DomU configure file ===========kernel = "/boot/vmlinuz-2.6.18.8-xen" memory = "256" name = "ubuntu.9-04" vif = [''''] dhcp = "dhcp" disk = [''file:/root/Xen/img/ubuntu-32/ubuntu.9-04.x86.img,sda1,w''] root = "/dev/sda1 ro" Execute the command "ifconfig" in DomU. ===========root@ubuntu:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:16:3e:56:f7:68 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:166 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:10991 (10.9 KB) TX bytes:1368 (1.3 KB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Execute the command "ifconfig" in Dom0. (My DomU id is 8. ) ===========[root@medmgmt-183 test1]# ifconfig eth0 Link encap:Ethernet HWaddr 00:24:E8:39:FA:54 inet addr:192.192.192.183 Bcast:192.192.192.255 Mask:255.255.255.0 inet6 addr: fe80::224:e8ff:fe39:fa54/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:241196 errors:0 dropped:0 overruns:0 frame:0 TX packets:24951 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:36847837 (35.1 MiB) TX bytes:3294724 (3.1 MiB) 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:7738 errors:0 dropped:0 overruns:0 frame:0 TX packets:7738 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4416210 (4.2 MiB) TX bytes:4416210 (4.2 MiB) peth0 Link encap:Ethernet HWaddr 00:24:E8:39:FA:54 inet addr:192.168.1.129 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::224:e8ff:fe39:fa54/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:254748 errors:0 dropped:0 overruns:0 frame:0 TX packets:26527 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:41250765 (39.3 MiB) TX bytes:3426922 (3.2 MiB) Memory:fe6e0000-fe700000 vif8.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:22 overruns:0 carrier:0 collisions:0 txqueuelen:32 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:29 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:5379 (5.2 KiB) Execute the command "ping 192.168.1.129" in DomU. (My Dom0''s IP is 192.168.1.129. ) ===========root@ubuntu:~# ping 192.168.1.20 connect: Network is unreachable Anyone can help me? Thank you very much! Gavin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I got it. I just set the vif=[''bridge=virbr0''] in the DomU configure file. And then, I can ping the dom0 successfully from DomU. I also can access to the internet from DomU. On my computer it is bridge=virbr0, but I think you also can try bridge=xenbr0 on your computer. However, I have another question. I cannot not assign the DomU ip address in its configure file. For example, vif=[''ip=192.168.122.20, bridge=virbr0''] does not work and my DomU‘s IP is assigned through the dhcp, that is 192.168.122.192. (My virbr0''s IP is 192.168.122.1) So how can I assign IP to the DomU? Mini-OS can also boot as a pv DomU. But how can i know its IP info if I set vif in its configure file? Thank you! Gavin 2010/9/28 Bei Guan <gbtju85@gmail.com>> Hi, > > I using pv ubuntu as DomU and my xen is 4.0.0. I can boot the DomU > successfully, but I can not access to internet in DomU. Event I ping the > Dom0 and it show "Network is unreachable". So how can I access to internet > in the pv domU and how can I ping the dom0 successfully? Some information is > as following. > > > DomU configure file > ===========> kernel = "/boot/vmlinuz-2.6.18.8-xen" > memory = "256" > name = "ubuntu.9-04" > vif = [''''] > dhcp = "dhcp" > disk = [''file:/root/Xen/img/ubuntu-32/ubuntu.9-04.x86.img,sda1,w''] > root = "/dev/sda1 ro" > > > Execute the command "ifconfig" in DomU. > ===========> root@ubuntu:~# ifconfig > eth0 Link encap:Ethernet HWaddr 00:16:3e:56:f7:68 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:166 errors:0 dropped:0 overruns:0 frame:0 > TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:10991 (10.9 KB) TX bytes:1368 (1.3 KB) > > lo Link encap:Local Loopback > inet addr:127.0.0.1 Mask:255.0.0.0 > UP LOOPBACK RUNNING MTU:16436 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) > > > Execute the command "ifconfig" in Dom0. (My DomU id is 8. ) > ===========> [root@medmgmt-183 test1]# ifconfig > eth0 Link encap:Ethernet HWaddr 00:24:E8:39:FA:54 > inet addr:192.192.192.183 Bcast:192.192.192.255 > Mask:255.255.255.0 > inet6 addr: fe80::224:e8ff:fe39:fa54/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:241196 errors:0 dropped:0 overruns:0 frame:0 > TX packets:24951 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:36847837 (35.1 MiB) TX bytes:3294724 (3.1 MiB) > > 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:7738 errors:0 dropped:0 overruns:0 frame:0 > TX packets:7738 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:4416210 (4.2 MiB) TX bytes:4416210 (4.2 MiB) > > peth0 Link encap:Ethernet HWaddr 00:24:E8:39:FA:54 > inet addr:192.168.1.129 Bcast:192.168.1.255 Mask:255.255.255.0 > inet6 addr: fe80::224:e8ff:fe39:fa54/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:254748 errors:0 dropped:0 overruns:0 frame:0 > TX packets:26527 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:100 > RX bytes:41250765 (39.3 MiB) TX bytes:3426922 (3.2 MiB) > Memory:fe6e0000-fe700000 > > vif8.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF > inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:22 overruns:0 carrier:0 > collisions:0 txqueuelen:32 > RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) > > virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 > inet addr:192.168.122.1 Bcast:192.168.122.255 > Mask:255.255.255.0 > inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:29 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:0 (0.0 b) TX bytes:5379 (5.2 KiB) > > > > Execute the command "ping 192.168.1.129" in DomU. (My Dom0''s IP is > 192.168.1.129. ) > ===========> root@ubuntu:~# ping 192.168.1.20 > connect: Network is unreachable > > > > Anyone can help me? Thank you very much! > > Gavin > > > > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-Sep-29 16:07 UTC
Re: [Xen-devel] Re: How to connect to the Internet in pv DomU
On 09/28/2010 09:21 PM, Bei Guan wrote:> I got it. > I just set the vif=[''bridge=virbr0''] in the DomU configure file. And > then, I can ping the dom0 successfully from DomU. I also can access to > the internet from DomU. On my computer it is bridge=virbr0, but I > think you also can try bridge=xenbr0 on your computer. > > However, I have another question. > > I cannot not assign the DomU ip address in its configure file. For > example, vif=[''ip=192.168.122.20, bridge=virbr0''] does not work and my > DomU‘s IP is assigned through the dhcp, that is 192.168.122.192. (My > virbr0''s IP is 192.168.122.1) > So how can I assign IP to the DomU?IP addresses are something that machines - virtual or physical - set for themselves. It might be statically configured, or it might be from a dhcp server, but either way the domain itself needs to do the setting. I guess in principle dom0 could stick the ip address into xenstore and the domU could fetch it from there, but AFAIK there''s no mechanism to do that. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel