Eric Sproul
2008-May-27 15:53 UTC
Cannot get second network interface working in Linux guest
Hi, I''m running snv_89 on an X4150 with a CentOS-5 guest. I cannot seem to get my second network interface to work properly. I followed the virt-install instructions, and even saw the FAQ entry about adding a second network instance in the XML config. I see my second device in the guest but it''s either connected to the wrong interface or not at all. I''d like to understand how xVM connects the virtual devices to physical ones-- I understand about the default-nic property of the xend service, but what about subsequent additions? In my dom0 I''m using e1000g0 and g1. g0 is the default-nic, which is on my internal private net. g1 is connected to my public DMZ net. I have tried pinging from within the domU, but don''t see the traffic when snooping in dom0 on either interface. Thanks in advance, Eric
Mark Johnson
2008-May-27 16:11 UTC
Re: Cannot get second network interface working in Linux guest
Eric Sproul wrote:> Hi, > I''m running snv_89 on an X4150 with a CentOS-5 guest. I cannot seem to get my > second network interface to work properly. I followed the virt-install > instructions, and even saw the FAQ entry about adding a second network instance > in the XML config. I see my second device in the guest but it''s either > connected to the wrong interface or not at all. > > I''d like to understand how xVM connects the virtual devices to physical ones-- I > understand about the default-nic property of the xend service, but what about > subsequent additions? >In a Solaris dom0, guests OSes get virtual nics which sits on top of a real NIC. in dom0, if you do a dladm show-link, you will see the real nics and virtual nics currently in your system. For the virtual NICs, you will see which NIC they are using. You can do the following to see which vnics map to you domains # /usr/lib/xen/bin/xenstore-ls /local/domain/0/backend/vif you can snoop on the vnic to get more info, e.g. # snoop -d vnic1 if you want to specify a guest to NIC mapping, put the following in the vif configuration. vif =[ ''bridge=e1000g1,...'', ...] MRJ> In my dom0 I''m using e1000g0 and g1. g0 is the default-nic, which is on my > internal private net. g1 is connected to my public DMZ net. I have tried > pinging from within the domU, but don''t see the traffic when snooping in dom0 on > either interface.
Eric Sproul
2008-May-27 16:31 UTC
Re: Cannot get second network interface working in Linux guest
Mark Johnson wrote:> in dom0, if you do a dladm show-link, you will see the > real nics and virtual nics currently in your system. > For the virtual NICs, you will see which NIC they are > using. > > You can do the following to see which vnics map to you > domainsAwesome, Mark, this is exactly what I needed. I now see the problem: $ sudo dladm show-link Password: LINK CLASS MTU STATE OVER e1000g2 phys 1500 unknown -- e1000g0 phys 1500 up -- e1000g1 phys 1500 up -- e1000g3 phys 1500 unknown -- vnic11 vnic 1500 unknown e1000g0 vnic12 vnic 1500 unknown e1000g0 Both vnics are on g0.> if you want to specify a guest to NIC mapping, put the following in > the vif configuration. > > > vif =[ ''bridge=e1000g1,...'', ...]Can you point me to where I set that? I haven''t been able to locate any config files, and that format doesn''t look like something that goes in the domU XML definition. Is the vif config part of xenstored? Thanks, Eric
Mark Johnson
2008-May-27 16:58 UTC
Re: Cannot get second network interface working in Linux guest
Eric Sproul wrote:> Mark Johnson wrote: >> in dom0, if you do a dladm show-link, you will see the >> real nics and virtual nics currently in your system. >> For the virtual NICs, you will see which NIC they are >> using. >> >> You can do the following to see which vnics map to you >> domains > > Awesome, Mark, this is exactly what I needed. I now see the problem: > > $ sudo dladm show-link > Password: > LINK CLASS MTU STATE OVER > e1000g2 phys 1500 unknown -- > e1000g0 phys 1500 up -- > e1000g1 phys 1500 up -- > e1000g3 phys 1500 unknown -- > vnic11 vnic 1500 unknown e1000g0 > vnic12 vnic 1500 unknown e1000g0 > > Both vnics are on g0. > >> if you want to specify a guest to NIC mapping, put the following in >> the vif configuration. >> >> >> vif =[ ''bridge=e1000g1,...'', ...] > > Can you point me to where I set that? I haven''t been able to locate any config > files, and that format doesn''t look like something that goes in the domU XML > definition. Is the vif config part of xenstored?The are a few different ways you can do this, but the quickest and dirtiest way is to shutdown the domain # xm list -l <domainname> > /tmp/<domainname>.sxp edit /tmp/<domainname>.sxp and add in thee bridge. (device (vif (bridge e1000g1) <**** (mac ... refresh the domain config, # xm new -F /tmp/<domainname>.sxp Make sure it got updated. # xm list -l <domainname> MRJ
Eric Sproul
2008-May-27 17:26 UTC
Re: Cannot get second network interface working in Linux guest
Mark Johnson wrote:> shutdown the domain > > # xm list -l <domainname> > /tmp/<domainname>.sxp > > edit /tmp/<domainname>.sxp and add in thee > bridge.Sweet, that''s done it. Thanks Mark! Eric