Hi, I have been trying for days now to get a working nat setup with my domU''s using the default nat scripts. I find the biggest problem being that each time a new domU is started, it gets thrown on a separate subnet. Here is an example of dom0''s network setup with 2 vm''s started: vif1.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF inet addr:10.0.1.128 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8601 errors:0 dropped:0 overruns:0 frame:0 TX packets:8932 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1997282 (1.9 MiB) TX bytes:2003904 (1.9 MiB) vif9.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF inet addr:10.0.9.128 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2 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:684 (684.0 b) TX bytes:0 (0.0 b) domU-1 : eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:01 inet addr:10.0.1.1 Bcast:10.0.255.255 Mask:255.255.0.0 domU-2 (default) eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:02 inet addr:10.0.9.1 Bcast:10.0.255.255 Mask:255.255.255.0 domU-2 (via dhcp) eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:02 inet addr:10.0.1.1 Bcast:10.0.255.255 Mask:255.255.0.0 my dhcpd conf: subnet 10.0.0.0 netmask 255.255.0.0 { range 10.0.1.10 10.0.1.100; option routers 10.0.1.128; option ip-forwarding off; option broadcast-address 10.0.255.255; option subnet-mask 255.255.0.0; option domain-name-servers 10.0.1.128; host mailserver { hardware ethernet 00:50:22:22:22:01; fixed-address 10.0.1.1; } host webserver { hardware ethernet 00:50:22:22:22:02; fixed-address 10.0.1.2; } } The problem is, no matter what i do, the interface for the domU on my dom0 gets ips in different subnets, therefore they can''t talk to each other and each domU requires a different gateway.. is there any way around this, it is getting very frustrating. Thanks, Jeff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> I have been trying for days now to get a working nat > setup with my domU''s using the default nat scripts.Just look at what the demo CD does for a nice example of how to set up NAT. Ian> I find the biggest problem being that each time a new domU is > started, it gets thrown on a separate subnet. > > Here is an example of dom0''s network setup with 2 vm''s started: > > vif1.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF > inet addr:10.0.1.128 Bcast:0.0.0.0 Mask:255.255.255.255 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:8601 errors:0 dropped:0 overruns:0 frame:0 > TX packets:8932 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:1997282 (1.9 MiB) TX bytes:2003904 (1.9 MiB) > > vif9.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF > inet addr:10.0.9.128 Bcast:0.0.0.0 Mask:255.255.255.255 > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:2 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:684 (684.0 b) TX bytes:0 (0.0 b) > > domU-1 : > > eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:01 > inet addr:10.0.1.1 Bcast:10.0.255.255 Mask:255.255.0.0 > > domU-2 (default) > > eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:02 > inet addr:10.0.9.1 Bcast:10.0.255.255 Mask:255.255.255.0 > > domU-2 (via dhcp) > > eth0 Link encap:Ethernet HWaddr 00:50:22:22:22:02 > inet addr:10.0.1.1 Bcast:10.0.255.255 Mask:255.255.0.0 > > my dhcpd conf: > > subnet 10.0.0.0 netmask 255.255.0.0 { > range 10.0.1.10 10.0.1.100; > option routers 10.0.1.128; > option ip-forwarding off; > option broadcast-address 10.0.255.255; > option subnet-mask 255.255.0.0; > option domain-name-servers 10.0.1.128; > host mailserver { > hardware ethernet 00:50:22:22:22:01; > fixed-address 10.0.1.1; > } > host webserver { > hardware ethernet 00:50:22:22:22:02; > fixed-address 10.0.1.2; > } > } > > > The problem is, no matter what i do, the interface for the > domU on my dom0 gets ips in different subnets, therefore they > can''t talk to each other and each domU requires a different > gateway.. is there any way around this, it is getting very > frustrating. > > Thanks, > Jeff > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ian Pratt wrote:> > >> I have been trying for days now to get a working nat >> setup with my domU''s using the default nat scripts. > > Just look at what the demo CD does for a nice example of how to set up > NAT. > > Ian >Ok, i checked that out, and it seemed to help me figure it out a lot. It looks like the key i was missing was having dhcp=dhcp in my xend config. Now each time a vm starts up it edits my dhcpd config and sets it up for that VM and the vm gets an ip and is setup to connect to the Internet. Wonderful. The problem still remains though, that each new VM i setup... or even if i stop a vm and start it, it ends up with a different ip. This makes the vm''s pretty useless if i want to forward ports to the vms. I always specify mac id''s for my vms: vif = [ ''mac=00:50:22:22:22:02''] if i specify an ip aswell: vif = [ ''mac=00:50:22:22:22:02, ip=10.0.1.2''] when i try to start that vm it complains something about vif 0 not being able to start if i try to write my own host rule in my dhcpd config specifying an ip for that vm by mac id... if the vm starts on vif 15.0, on dom0 the ip will be 10.0.15.1 the domU would get 10.0.1.2 from the dhcp server, however the domU won''t be able to access the Internet at all. so.. i''m getting close, any more ideas? Thanks, Jeff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users