Hello all, First of all I''m using Xen 3 under CentOS 5.2 Dom0. The Dom0 has a public (Internet) IP address. I have a CentOS DomU which works fine using DHCP and the default CentOS virbr0 bridge. And the DomU /etc/resolv.conf points to nameserver 192.168.122.1 (Dom0). However I want this DomU to use a different static public IP address. Reading the mailing list archives and various blog plots it seems like I should be able to simply do this using bridging, instead of routing. But I am having some trouble getting it to work. Would appreciate some help in this regard. Firstly my Dom0 has a IP (let''s say) 75.59.43.140 with gateway 75.59.43.190 given to me with the server. I have then been given (let''s say) 75.59.18.150 and using same gateway 75.59.43.190. I was under the impression I simply need to diable DHCP assign these IP addresses to my DomU (i.e. edit /etc/sysconfig/network-scripts/ifcfg-eth0) and my VM config file can remain the same, still using virbr0. However this does not work as, e.g. I can''t resolve google.com, and when performing an ifconfig on the DomU the broadcast address seems very weird? Attempting to change the NS in the resolv.conf file to the same as the Dom0''s doesn''t seem to help either. Can someone point me in the right direction, preferably to some concrete settings/examples? I''m sure this shouldn''t be so difficult, it''s hard to find anything really concrete on the net though which is frustrating (but I suppose that''s inevitable due to the uniqueness of everyone''s network setup). Regards _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2009/3/27 Ravikesh Chandra <rcha108@aucklanduni.ac.nz>:> I have a CentOS DomU which works fine using DHCP and the default CentOS > virbr0 bridge.> Firstly my Dom0 has a IP (let''s say) 75.59.43.140 with gateway 75.59.43.190 > given to me with the server. > I have then been given (let''s say) 75.59.18.150 and using same gateway > 75.59.43.190.Is this for real? Are you REALLY using a netmask of 255.255.0.0 (or similar)?> > I was under the impression I simply need to diable DHCP assign these IP > addresses to my DomU (i.e. edit /etc/sysconfig/network-scripts/ifcfg-eth0) > and my VM config file can remain the same, still using virbr0.You need to change the bridge as well. Try doing "brctl show". Most likely you simply need to change the bridge to xenbr0. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Fri, Mar 27, 2009 at 2:46 PM, Ravikesh Chandra <rcha108@aucklanduni.ac.nz> wrote:>> > Firstly my Dom0 has a IP (let''s say) 75.59.43.140 with gateway >> > 75.59.43.190 >> > given to me with the server. >> > I have then been given (let''s say) 75.59.18.150 and using same gateway >> > 75.59.43.190. >> >> Is this for real? Are you REALLY using a netmask of 255.255.0.0 (or >> similar)? >> > > Thanks for your reply. Well yes those are the IPs that I have been given... > to be honest I''m not very well versed in networking so please tell me if > they seem ''wrong'' for instance I was surprised that I should use the same > gateway?Please keep list traffic on the list. It''s basic TCP/IP, actually. The host IP address and gateway should be on the same network. http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing http://en.wikipedia.org/wiki/Subnetwork> > Anyway I have changed the bridge as you have suggested and now the output of > "brctl show" seems correct: > xenbr0 8000.feffffffffff no vif35.0 > peth0 > vif0.0 > > So the DomU (vif35.0) is properly bridged with Dom0 (peth0, vif0.0) I>From that output, yes. That is assuming your network guys put twodifferent IP networks on the same link (which is eth0 on your server) without vlan or anything. Not recommended, but possible.> assume? Unfortunately I still don''t seem to have any network access from the > DomU, here is the snippet from the Xen config file (with same settings in > OS): > > vif = [ "ip=75.59.13.145,mac=00:16:3e:01:9d:36,bridge=xenbr0" ] > netmask = "255.255.255.248" > gateway = "75.59.43.190"I prefer to have IP setup inside domU using the usual scripts. On redhat it''s /etc/sysconfig/network-scripts/ifcfg-eth0 (or similar). That means on xen config file it''s enough to put something like this vif = [ "mac=00:16:3e:01:9d:36,bridge=xenbr0" ] Your IP, netmask, and gateway combo is not right. They''re not on the same network. Ask your network guys. One way to easily test connectivity is to use an IP address in the same network as dom0, and ping dom0 from domU. So (for example) if dom0 has IP address 10.0.0.2/24, you can assign domU 10.0.0.3/24 and ping dom0 from domU. Again, this is just an example. You should ask your network guys to assign an IP address on the same network as your dom0. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
As an update to this post I can report that I have gotten the desired network functionality working for me. Basically I found that the configuration I need to use matches exactly this: http://www.debian-administration.org/articles/360 (see Diagram). Let''s say that in my case the IPs are: 77.56.44.157 <- server 77.56.44.190 <- gateway 77.56.14.144/29 <- provided IPs for my DomUs Unfortunately although I tried a lot, I couldn''t figure out exactly how to set up a bridged configuration using the dummy interface on my CentOS server as in the linked Debian article. In the end I have managed to get networking going using routed configuration, and these are the settings I''ve used (they may help someone?): ---8<--- Dom0: # cat /etc/sysconfig/network-scripts/ifcfg-eth0 .. NETMASK=255.255.255.192 IPADDR=77.56.44.157 GATEWAY=77.56.44.190 TYPE=Ethernet Dom0: # /etc/xen/xend-config.sxp bridging commented, routing enabled Dom0 Xen VM cfg: # cat /etc/xen/vm01 .. vif = [ "ip=77.56.14.146" ] NETMASK="255.255.0.0" GATEWAY="77.56.44.190" DomU: # cat /etc/sysconfig/network-scripts/ifcfg-eth0 .. IPADDR=77.56.14.146 NETMASK=255.255.0.0 GATEWAY=77.56.44.190 ---8<--- So in routing mode these settings work fine, thankfully. However I would really appreciate any insight as to what possibly I could have been doing wrong when trying to use bridged mode? I.e. how could this configuration be adapted for bridging? As most of what I read seems to indicate bridging is the preferable mode. Thanks, Ravikesh _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Sun, Mar 29, 2009 at 7:47 AM, Ravikesh Chandra <rcha108@aucklanduni.ac.nz> wrote:> As an update to this post I can report that I have gotten the desired > network functionality working for me. Basically I found that the > configuration I need to use matches exactly this: > http://www.debian-administration.org/articles/360 (see Diagram). Let''s sayNo it''s not. Not if you neglect to mention (as stated in that site) "The new IP addresses were each routed via my existing public address". Had you mention it it would''ve been much simpler. There''s a big difference in "use the same gateway as your exisiting address" and "the new addresses are routed via your existing address".> Unfortunately although I tried a lot, I couldn''t figure out exactly how to > set up a bridged configuration using the dummy interface on my CentOS serverAssuming your newly-assigned IP address range is 77.56.14.144/29, you could probably create /etc/sysconfig/network-scripts/ifcfg-br14 on dom0 with DEVICE=br14 BOOTPROTO=none ONBOOT=yes TYPE=Bridge IPADDR=77.56.14.145 NETMASK=255.255.255.248 and set domU to use br14. You also need to enable ipv4 packet forwarding on dom0 (something like "net.ipv4.ip_forward = 1" on sysctl.conf)> as in the linked Debian article. In the end I have managed to get networking > going using routed configuration, and these are the settings I''ve used (they > may help someone?): >> DomU: # cat /etc/sysconfig/network-scripts/ifcfg-eth0 > .. > IPADDR=77.56.14.146 > NETMASK=255.255.0.0 > GATEWAY=77.56.44.190That doesn''t look right. Again, you should compare the config you got with the one on the example. domU''s ifcfg-eth0 should be something like IPADDR=77.56.14.146 NETMASK=255.255.255.248 GATEWAY=77.56.14.145 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users