Siddharth Wagh
2009-Jun-03 16:03 UTC
[Xen-users] DHCP server on Dom-0: guests fail to connect
Hello all, I am working on a Centos 5.2 installation using Xen 3.0, and trying to set up a DHCP server on Domain-0 so as to assign a range of IP addresses to new guests. I installed dhcp package on Dom-0 and here are contents of dhcpd.conf file (Dom-0 has eth0 - 128.6.237.10 and eth1 - 192.168.2.21 over crossover cable): ==================================================ddns-update-style interim; ignore client-updates; authoritative; subnet 128.6.237.0 netmask 255.255.255.0 { host eth0 { hardware ethernet 00:21:9B:FC:D9:E9; fixed-address 128.6.237.10; } } subnet 192.168.2.0 netmask 255.255.255.0 { host eth1 { hardware ethernet 00:21:9B:FC:D9:EA; fixed-address 192.168.2.21; } } # range of addresses to be assigned to new guests subnet 192.168.1.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.1.1; option subnet-mask 255.255.255.0; option domain-name "dw.vnet"; option domain-name-servers 128.6.236.5, 128.6.224.114; option time-offset -18000; # Eastern Standard Time range 192.168.1.128 192.168.1.254; } default-lease-time 21600; max-lease-time 43200; ============================================== /etc/init.d/dhcpd start Starting DHCP [OK] Then I am trying to create a guest with config file: ===============================================name = "sw_cp_fed8" maxmem = 512 memory = 512 vcpus = 4 bootloader = "/usr/bin/pygrub" on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" #vfb = [ "type=vnc,vncunused=1,keymap=en-us" ] disk = [ "tap:aio:/var/lib/xen/images/sw_cp_fed8.img,xvda,w" ] vif = [''''] dhcp="dhcp" =============================================== But the guest fails to start Error: TCP/IP error: VNC connection to hypervisor host got refused /var/log/messages says: ================================================Jun 3 11:42:13 darkwing kernel: tap tap-62-51712: 2 getting info Jun 3 11:42:14 darkwing kernel: device vif62.0 entered promiscuous mode Jun 3 11:42:14 darkwing kernel: ADDRCONF(NETDEV_UP): vif62.0: link is not ready Jun 3 11:42:14 darkwing kernel: blktap: ring-ref 8, event-channel 17, protocol 1 (x86_64-abi) Jun 3 11:42:25 darkwing kernel: virbr0: port 1(vif62.0) entering disabled state Jun 3 11:42:25 darkwing kernel: device vif62.0 left promiscuous mode Jun 3 11:42:25 darkwing kernel: virbr0: port 1(vif62.0) entering disabled state =============================================== *I need to run about 10 Virtual machines allotted dynamic IPs from DHCP server on Dom-0. Then I am seeking to stress test them on the machine, to study performance isolation among guests. Can anyone help and guide me? Am I on the right path?* Thanks & Regards, Siddharth Wagh MS, Electrical & Computer Engineering Rutgers University, NJ Web: http://www.eden.rutgers.edu/~swagh/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jun-04 13:20 UTC
Re: [Xen-users] DHCP server on Dom-0: guests fail to connect
On Wed, Jun 3, 2009 at 11:03 PM, Siddharth Wagh <siddharth.wagh@gmail.com> wrote:> (Dom-0 has eth0 - 128.6.237.10 and eth1 - 192.168.2.21 over crossover > cable): > > # range of addresses to be assigned to new guests > > subnet 192.168.1.0 netmask 255.255.255.0 {does dom0 has an interface with 192.168.1.0/24 address? If not, that block will be ignored by default.> #vfb = [ "type=vnc,vncunused=1,keymap=en-us" ]> But the guest fails to start > Error: > TCP/IP error: VNC connection to hypervisor host got refusedHow did you start this guest? Since you disable vfb line, it''s only normal that there won''t be any GUI console for that PV guest. This is not related to DHCP btw. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jun-05 01:53 UTC
Re: [Xen-users] DHCP server on Dom-0: guests fail to connect
On Thu, Jun 4, 2009 at 10:39 PM, Siddharth Wagh <siddharth.wagh@gmail.com> wrote:> vif = [ "mac=00:16:3e:3d:2c:fa,bridge=xenbr0" ] > =====================================> > 2. Then, I set out to remove their static addressing and assign the same VMs > new IPs using DHCP. So, I made following changes: > a. Installed DHCP on Dom-0 > b. Changed dhcpd.conf file as given above (I am attempting to give range of > private addresses to VMs, I am not sure how to connect them to Dom-0 or how > to create interface on Dom-0 for same) > c. Changed guest VM file as follows: > ================================= > dhcp = "dhcp" > vif = [ '''' ]> CAN YOU TELL ME HOW DO I GO ABOUT HOW TO ASSIGN IPs TO GUEST VMs ON THE RUN > AND NOT STATICALLY? THANKS A LOT FOR YOUR REPLY.Your main problem is that you misunderstood how Xen networking works. In short, when you use bridging (the default on most distros), you''ll essentially have a domU that behaves just like any other machine on the network. That means you don''t need to alter domU config. At all. It wouldn''t matter as the OS on domU can change it anyway. What you should do is you should return the domU config to the original one, and learn how to setup DHCP properly. Since the bridge is xenbr0, the process would be the same as setting DHCP server where clients are connected to DHCP server''s eth0. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jun-10 01:06 UTC
Re: [Xen-users] DHCP server on Dom-0: guests fail to connect
On Tue, Jun 9, 2009 at 11:17 PM, Siddharth Wagh<siddharth.wagh@gmail.com> wrote:> Hello, > > Scrapping off DHCP, I am working on following NAT approach with static > addresses to VMs... > I did the following: > 1. Changed xend-config.sxp file as: > (network-type network-nat) > (vif-script vif-nat)Since you''re using Centos anyway, by default it has libvirtd which does what you want by default. It creates virbr0, with address 192.168.122.0/24, using network-bridge script. So its NAT on top of bridge. As a bonus, it also uses "builtin" dhcp and dns server for domUs so you don''t have to worry about that. You simply use thye default setting (network-bridge) and point your domU config to use virbr0 bridge. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Jun-12 02:33 UTC
Re: [Xen-users] DHCP server on Dom-0: guests fail to connect
On Thu, Jun 11, 2009 at 10:26 PM, Siddharth Wagh<siddharth.wagh@gmail.com> wrote:> Please pardon me for bothering you, but I tried to use virbr0 as you > suggested but it doesnt seem to work. While creating guest using > virt-manager, it gives me the option of using "peth0 (bridge:xenbr0)" as > shared physical device (I am connected to Ethernet) and not virbr0. How do I > point to the virbr0 bridge then??virt-manager on my system lets me choose "virtual network", "default". Don''t use shared physical device if you need to use virbr0. As an alternative, you could also create domU config file manually (something like http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU) and tell it to use virbr0. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users