Kay Schubert
2009-Aug-23 11:22 UTC
[Xen-users] xen network interfaces: How do I retrieve from an executable running within domain0 the MAC of an frontend-(domainU)-network-interface ?
Hello, I use xen as provided by openSUSE 11.1 . What I want to do is this: Operate several domainU. All of them have a xennet network interface, whose respective backend-interfaces at the domain0 are added to a boilerplate linux bridge. No physical interfaces are added to the bridge (in other words: a virtual ethernet). Now each of those backend-interfaces gets assigned the infamous FE:FF:FF:FF:FF:FF MAC. That turns out to be a problem if I try to send packets from domain0 through the bridge-interface to any of the domainU instances: the log tells me something along "ethernet source and target are equal, can''t send packets to myself". However, I had some success when I manually assigned (by calling at domain0, for instance, "ip link set vif13.1 address 00:16:3E:7D:D0:98") the MAC assigned to the frontend-(domainU)-interface to the backend-(domain0)-interface as well. I obtained the MAC manually, by looking into the configuration files in /etc/xen/vm/ and manually identifying associated backend-(domain0)-interfaces. Now my question is: Supposed an executable is running within domain0, and this executable has been handed the name of a Xen backend interface, is there a way to obtain the MAC of the associated frontend-(domainU)-interface ? Thank you very much, Kay _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2009-Aug-23 14:37 UTC
Re: [Xen-users] xen network interfaces: How do I retrieve from an executable running within domain0 the MAC of an frontend-(domainU)-network-interface ?
On Sun, Aug 23, 2009 at 6:22 PM, Kay Schubert<kayegypt@web.de> wrote:> Now each of those backend-interfaces gets assigned the > infamous FE:FF:FF:FF:FF:FF MAC. That turns out to be a problem if I try to > send packets from domain0 through the bridge-interface to any of the domainU > instances: the log tells me something along "ethernet source and target are > equal, can''t send packets to myself".I had that problem on some dom0s as well :) Interestingly it doesn''t occur when I split dom0 and domUs traffic on separate physical interfaces. For example : - eth0 for dom0''s IP address - eth1 setup as trunk, created vlans and bridge on top of vlans, no IP address on those bridges, with domU using the bridges.> However, I had some success when I > manually assigned (by calling at domain0, for instance, "ip link set vif13.1 > address 00:16:3E:7D:D0:98") the MAC assigned to the > frontend-(domainU)-interface to the backend-(domain0)-interface as well.Actually, it doesn''t matter what MAC you assign to the vif, as long as it''s unique. At least that was the case on my setup. So I simply modify /etc/xen/scripts/vif-bridge, and generate a random MAC for every vif. It''s not the same as domU''s MAC.> Now my question is: Supposed an executable is running within domain0, and this > executable has been handed the name of a Xen backend interface, is there a > way to obtain the MAC of the associated frontend-(domainU)-interface ?If you still need domU''s mac (for any reason), you could try this - xm network-list 13 - xenstore-ls /local/domain/13/device/vif where "13" in that example is domU''s ID. You could usually find out domU id from vif name (in your case vif13.1). I haven''t tried running it from vif-bridge script though. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Kay Schubert
2009-Aug-25 07:10 UTC
Re: [Xen-users] xen network interfaces: How do I retrieve from an executable running within domain0 the MAC of an frontend-(domainU)-network-interface ?
Am Sunday 23 August 2009 16:37:25 schrieb Fajar A. Nugraha:> On Sun, Aug 23, 2009 at 6:22 PM, Kay Schubert<kayegypt@web.de> wrote: > > Now each of those backend-interfaces gets assigned the > > infamous FE:FF:FF:FF:FF:FF MAC. That turns out to be a problem if I try > > to send packets from domain0 through the bridge-interface to any of the > > domainU instances: the log tells me something along "ethernet source and > > target are equal, can''t send packets to myself". > > I had that problem on some dom0s as well :) > Interestingly it doesn''t occur when I split dom0 and domUs traffic on > separate physical interfaces. For example : > - eth0 for dom0''s IP address > - eth1 setup as trunk, created vlans and bridge on top of vlans, no IP > address on those bridges, with domU using the bridges. > > > However, I had some success when I > > manually assigned (by calling at domain0, for instance, "ip link set > > vif13.1 address 00:16:3E:7D:D0:98") the MAC assigned to the > > frontend-(domainU)-interface to the backend-(domain0)-interface as well. > > Actually, it doesn''t matter what MAC you assign to the vif, as long as > it''s unique. At least that was the case on my setup. So I simply > modify /etc/xen/scripts/vif-bridge, and generate a random MAC for > every vif. It''s not the same as domU''s MAC.Ah, you are conforming a suspicion I had ...> > > Now my question is: Supposed an executable is running within domain0, and > > this executable has been handed the name of a Xen backend interface, is > > there a way to obtain the MAC of the associated > > frontend-(domainU)-interface ? > > If you still need domU''s mac (for any reason), you could try this > - xm network-list 13 > - xenstore-ls /local/domain/13/device/vifYes, five minutes after I had sent my question I looked up "xenstore" at Google, and came to http://wiki.xensource.com/xenwiki/XenStore, where a little script resides, that dumps the xenstore''s content. And there it was. Its always the same: When you finally resolve to ask someone else, and think about how to shape your question, suddenly the answer is lurking somewhere near ...> > where "13" in that example is domU''s ID. You could usually find out > domU id from vif name (in your case vif13.1). I haven''t tried running > it from vif-bridge script though.openSUSE doesn''t use the scripts provided by Xen. They process xen network interfaces through scripts in /etc/sysconfig/network/scripts (as they do for all network interfaces, whatever kind) where one can add custom scripts. I will try my luck there. Thank you very much! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users