Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-07-15 Thread poma


This sometimes works, sometimes not. :)
https://bugzilla.redhat.com/show_bug.cgi?id=1119481


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-07-15 Thread poma

On 15.07.2014 09:01, poma wrote:


This sometimes works, sometimes not. :)
https://bugzilla.redhat.com/show_bug.cgi?id=1119481



Resolved.
https://bugzilla.redhat.com/attachment.cgi?id=918197
https://bugzilla.redhat.com/attachment.cgi?id=918198


poma

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-07-15 Thread Tom Gundersen
On Tue, Jul 15, 2014 at 6:33 PM, poma pomidorabelis...@gmail.com wrote:
 On 15.07.2014 09:01, poma wrote:


 This sometimes works, sometimes not. :)
 https://bugzilla.redhat.com/show_bug.cgi?id=1119481


 Resolved.
 https://bugzilla.redhat.com/attachment.cgi?id=918197
 https://bugzilla.redhat.com/attachment.cgi?id=918198


Thanks! Fixed in git.

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-16 Thread poma



Whether predictable EHA may be applicable to bonding also?


To remind myself without caffeine, heh.

https://www.kernel.org/doc/Documentation/networking/bonding.txt

15. Frequently Asked Questions

8.  Where does a bonding device get its MAC address from?

When using slave devices that have fixed MAC addresses, or when
the fail_over_mac option is enabled, the bonding device's MAC address is
the MAC address of the active slave.

For other configurations, if not explicitly configured (with
ifconfig or ip link), the MAC address of the bonding device is taken from
its first slave device.  This MAC address is then passed to all following
slaves and remains persistent (even if the first slave is removed) until
the bonding device is brought down or reconfigured.

If you wish to change the MAC address, you can set it with
ifconfig or ip link:

# ifconfig bond0 hw ether 00:11:22:33:44:55

# ip link set bond0 address 66:77:88:99:aa:bb

The MAC address can be also changed by bringing down/up the
device and then changing its slaves (or their order):

# ifconfig bond0 down ; modprobe -r bonding
# ifconfig bond0  up
# ifenslave bond0 eth...

This method will automatically take the address from the next
slave that is added.

To restore your slaves' MAC addresses, you need to detach them
from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
then restore the MAC addresses that the slaves had before they were
enslaved.


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-16 Thread poma


MACA ddress in addition to
/etc/systemd/network/bridge0.netdev:
[NetDev]
Name=bridge0
Kind=bridge
MACAddress=00:12:34:56:78:90

The rest is here:
https://bugzilla.redhat.com/attachment.cgi?id=881142

journal-sd-networkd-214-2.git4997cb9.20140615-3.16.0-0.rc:
[   16.629830] sd[1]: Starting Network Service...
[   18.451500] netd[528]: timestamp of '/etc/sd/network' changed
[   19.486750] netd[528]: bridge0 : creating netdev
[   19.486975] netd[528]: bridge0 : loaded bridge
[   19.824382] netd[528]: bond0   : creating netdev
[   19.824636] netd[528]: bond0   : loaded bond
[   20.077173] netd[528]: sd-rtnl: discarding 20 bytes of incoming message
[   20.077422] netd[528]: bond0   : link 6 added
[   20.077637] netd[528]: bond0   : udev initialized link
[   20.077848] netd[528]: bond0   : netdev has index 6
[   20.078041] netd[528]: bond0   : netdev ready
[   20.078256] netd[528]: bond0   : flags change: +MASTER +MULTICAST 
+BROADCAST
[   20.078469] netd[528]: bridge0 : link 5 added
[   20.078652] netd[528]: bridge0 : udev initialized link
[   20.078861] netd[528]: bridge0 : netdev has index 5
[   20.079091] netd[528]: bridge0 : netdev ready
[   20.079279] netd[528]: bridge0 : flags change: +MULTICAST +BROADCAST
[   20.079492] netd[528]: enp3s0  : link 4 added
[   20.079706] netd[528]: enp3s0  : udev initialized link
[   20.079914] netd[528]: enp3s0  : flags change: +MULTICAST +BROADCAST
[   20.080140] netd[528]: enp1s9  : link 3 added
[   20.080349] netd[528]: enp1s9  : udev initialized link
[   20.080562] netd[528]: enp1s9  : flags change: +MULTICAST +BROADCAST
[   20.080760] netd[528]: enp1s6  : link 2 added
[   20.080971] netd[528]: enp1s6  : udev initialized link
[   20.081193] netd[528]: enp1s6  : flags change: +MULTICAST +BROADCAST
[   20.081409] netd[528]: lo  : link 1 added
[   20.081656] netd[528]: lo  : udev initialized link
[   20.081894] netd[528]: lo  : flags change: +LOOPBACK +UP 
+LOWER_UP +RUNNING
[   20.082122] netd[528]: lo  : gained carrier
[   20.082365] netd[528]: bridge0 : udev initialized link
[   20.082575] netd[528]: bond0   : udev initialized link
[   20.082801] netd[528]: Sent message type=method_call sender=n/a 
destination=org.freedesktop.DBus object=/org/freedesktop/DBus 
interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 error=n/a
[   20.083047] sd[1]: Started Network Service.
[   20.083305] netd[528]: bond0   : netdev exists, using existing
[   20.083807] netd[528]: Got message type=method_return 
sender=org.freedesktop.DBus destination=:1.6 object=n/a interface=n/a 
member=n/a cookie=1 reply_cookie=1 error=n/a
[   20.084098] netd[528]: Got message type=signal sender=org.freedesktop.DBus 
destination=:1.6 object=/org/freedesktop/DBus interface=org.freedesktop.DBus 
member=NameAcquired cookie=2 reply_cookie=0 error=n/a
[   20.084317] netd[528]: bond0   : link state is up-to-date
[   20.084523] netd[528]: bond0   : found matching network 
'/etc/sd/network/bond0bridge0.network'
[   20.084745] netd[528]: bond0   : enslaving by 'bridge0'
[   20.084951] netd[528]: bridge0 : enslaving link 'bond0'
[   20.085168] netd[528]: bridge0 : getting address failed: Device or 
resource busy
[   20.085378] netd[528]: bridge0 : link state is up-to-date
[   20.085583] netd[528]: bridge0 : found matching network 
'/etc/sd/network/bridge0dhcp.network'
[   20.085778] netd[528]: bridge0 : bringing link up
[   20.085978] netd[528]: enp3s0  : getting address failed: Device or 
resource busy
[   20.086423] netd[528]: enp3s0  : link state is up-to-date
[   20.086619] netd[528]: enp3s0  : found matching network 
'/etc/sd/network/enp3s0bond0.network'
[   20.086813] netd[528]: enp3s0  : enslaving by 'bond0'
[   20.095531] netd[528]: bond0   : enslaving link 'enp3s0'
[   20.095742] netd[528]: enp1s9  : getting address failed: Device or 
resource busy
[   20.095939] netd[528]: enp1s9  : link state is up-to-date
[   20.096150] netd[528]: enp1s9  : found matching network 
'/etc/sd/network/enp1s9bond0.network'
[   20.096344] netd[528]: enp1s9  : enslaving by 'bond0'
[   20.103923] netd[528]: bond0   : enslaving link 'enp1s9'
[   20.104192] netd[528]: enp1s6  : getting address failed: Device or 
resource busy
[   20.104416] netd[528]: enp1s6  : link state is up-to-date
[   20.104656] netd[528]: enp1s6  : unmanaged
[   20.104870] netd[528]: lo  : getting address failed: Device or 
resource busy
[   20.105123] netd[528]: lo  : link state is up-to-date
[   20.105357] netd[528]: lo  : unmanaged
[   20.105575] netd[528]: sd-rtnl: discarding 20 bytes 

Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-16 Thread Tom Gundersen
Hi poma,

So do I understand correctly that it all works as expected for you now?

Cheers,

Tom

On Mon, Jun 16, 2014 at 3:05 PM, poma pomidorabelis...@gmail.com wrote:

 MACA ddress in addition to
 /etc/systemd/network/bridge0.netdev:
 [NetDev]
 Name=bridge0
 Kind=bridge
 MACAddress=00:12:34:56:78:90

 The rest is here:
 https://bugzilla.redhat.com/attachment.cgi?id=881142

 journal-sd-networkd-214-2.git4997cb9.20140615-3.16.0-0.rc:
 [   16.629830] sd[1]: Starting Network Service...
 [   18.451500] netd[528]: timestamp of '/etc/sd/network' changed
 [   19.486750] netd[528]: bridge0 : creating netdev
 [   19.486975] netd[528]: bridge0 : loaded bridge
 [   19.824382] netd[528]: bond0   : creating netdev
 [   19.824636] netd[528]: bond0   : loaded bond
 [   20.077173] netd[528]: sd-rtnl: discarding 20 bytes of incoming message
 [   20.077422] netd[528]: bond0   : link 6 added
 [   20.077637] netd[528]: bond0   : udev initialized link
 [   20.077848] netd[528]: bond0   : netdev has index 6
 [   20.078041] netd[528]: bond0   : netdev ready
 [   20.078256] netd[528]: bond0   : flags change: +MASTER +MULTICAST
 +BROADCAST
 [   20.078469] netd[528]: bridge0 : link 5 added
 [   20.078652] netd[528]: bridge0 : udev initialized link
 [   20.078861] netd[528]: bridge0 : netdev has index 5
 [   20.079091] netd[528]: bridge0 : netdev ready
 [   20.079279] netd[528]: bridge0 : flags change: +MULTICAST
 +BROADCAST
 [   20.079492] netd[528]: enp3s0  : link 4 added
 [   20.079706] netd[528]: enp3s0  : udev initialized link
 [   20.079914] netd[528]: enp3s0  : flags change: +MULTICAST
 +BROADCAST
 [   20.080140] netd[528]: enp1s9  : link 3 added
 [   20.080349] netd[528]: enp1s9  : udev initialized link
 [   20.080562] netd[528]: enp1s9  : flags change: +MULTICAST
 +BROADCAST
 [   20.080760] netd[528]: enp1s6  : link 2 added
 [   20.080971] netd[528]: enp1s6  : udev initialized link
 [   20.081193] netd[528]: enp1s6  : flags change: +MULTICAST
 +BROADCAST
 [   20.081409] netd[528]: lo  : link 1 added
 [   20.081656] netd[528]: lo  : udev initialized link
 [   20.081894] netd[528]: lo  : flags change: +LOOPBACK +UP
 +LOWER_UP +RUNNING
 [   20.082122] netd[528]: lo  : gained carrier
 [   20.082365] netd[528]: bridge0 : udev initialized link
 [   20.082575] netd[528]: bond0   : udev initialized link
 [   20.082801] netd[528]: Sent message type=method_call sender=n/a
 destination=org.freedesktop.DBus object=/org/freedesktop/DBus
 interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0
 error=n/a
 [   20.083047] sd[1]: Started Network Service.
 [   20.083305] netd[528]: bond0   : netdev exists, using existing
 [   20.083807] netd[528]: Got message type=method_return
 sender=org.freedesktop.DBus destination=:1.6 object=n/a interface=n/a
 member=n/a cookie=1 reply_cookie=1 error=n/a
 [   20.084098] netd[528]: Got message type=signal
 sender=org.freedesktop.DBus destination=:1.6 object=/org/freedesktop/DBus
 interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0
 error=n/a
 [   20.084317] netd[528]: bond0   : link state is up-to-date
 [   20.084523] netd[528]: bond0   : found matching network
 '/etc/sd/network/bond0bridge0.network'
 [   20.084745] netd[528]: bond0   : enslaving by 'bridge0'
 [   20.084951] netd[528]: bridge0 : enslaving link 'bond0'
 [   20.085168] netd[528]: bridge0 : getting address failed: Device
 or resource busy
 [   20.085378] netd[528]: bridge0 : link state is up-to-date
 [   20.085583] netd[528]: bridge0 : found matching network
 '/etc/sd/network/bridge0dhcp.network'
 [   20.085778] netd[528]: bridge0 : bringing link up
 [   20.085978] netd[528]: enp3s0  : getting address failed: Device
 or resource busy
 [   20.086423] netd[528]: enp3s0  : link state is up-to-date
 [   20.086619] netd[528]: enp3s0  : found matching network
 '/etc/sd/network/enp3s0bond0.network'
 [   20.086813] netd[528]: enp3s0  : enslaving by 'bond0'
 [   20.095531] netd[528]: bond0   : enslaving link 'enp3s0'
 [   20.095742] netd[528]: enp1s9  : getting address failed: Device
 or resource busy
 [   20.095939] netd[528]: enp1s9  : link state is up-to-date
 [   20.096150] netd[528]: enp1s9  : found matching network
 '/etc/sd/network/enp1s9bond0.network'
 [   20.096344] netd[528]: enp1s9  : enslaving by 'bond0'
 [   20.103923] netd[528]: bond0   : enslaving link 'enp1s9'
 [   20.104192] netd[528]: enp1s6  : getting address failed: Device
 or resource busy
 [   20.104416] netd[528]: enp1s6  : link state is up-to-date
 [   20.104656] netd[528]: enp1s6  : unmanaged
 [   20.104870] netd[528]: lo  

Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-16 Thread poma

On 06/16/2014 03:09 PM, Tom Gundersen wrote:

Hi poma,

So do I understand correctly that it all works as expected for you now?

Cheers,

Tom


Yep!


poma


man: networkd - netdev MAC addition

diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index c17ae9e..931d806 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -147,6 +147,13 @@
 is compulsory./para
 /listitem
 /varlistentry
+varlistentry
+termvarnameMACAddress=/varname/term
+listitem
+paraThe MAC address to use. Currently literalbridge/literal
+is supported. This is optional./para
+/listitem
+/varlistentry
 /variablelist
 
 paraThe literal[VLAN]/literal section only applies for netdevs of kind literalvlan/literal,

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-08 Thread poma

On 05.06.2014 12:05, Tom Gundersen wrote:

Thanks for the reminder. I'll revert the revert :)

We grew some more features since it was first introduced, so will have
to check out how it all works with tunnels, veth devices etc, but
should definitely have this back for 314.

Cheers,

Tom


Predictable bridge EHA tested  works with these this combination:
- sd git efe6e7d
- kernels 3.15.0-0.rc8.git4.1.fc21.x86_64  3.14.[56]-200.fc20.x86_64+debug

Whether predictable EHA may be applicable to bonding also?


poma




On Thu, Jun 5, 2014 at 12:00 PM, poma pomidorabelis...@gmail.com wrote:


Bridgetto is in the stable 3.14.5 kernel.

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=4a68caa
https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.14.5
.
commit 4a68caa1b3d3f382bde56a6a3d3430bcb53ecf7f
Author: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
Date:   Fri Apr 25 17:01:18 2014 +0900

 bridge: Handle IFLA_ADDRESS correctly when creating bridge device
 [ Upstream commit 30313a3d5794472c3548d7288e306a5492030370 ]
 When bridge device is created with IFLA_ADDRESS, we are not calling
 br_stp_change_bridge_id(), which leads to incorrect local fdb
 management and bridge id calculation, and prevents us from receiving
 frames on the bridge device.
 Reported-by: Tom Gundersen t...@jklm.no
 Signed-off-by: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
 Signed-off-by: David S. Miller da...@davemloft.net
 Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


poma




___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-05 Thread poma


Bridgetto is in the stable 3.14.5 kernel.

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=4a68caa
https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.14.5
.
commit 4a68caa1b3d3f382bde56a6a3d3430bcb53ecf7f
Author: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
Date:   Fri Apr 25 17:01:18 2014 +0900

bridge: Handle IFLA_ADDRESS correctly when creating bridge device

[ Upstream commit 30313a3d5794472c3548d7288e306a5492030370 ]

When bridge device is created with IFLA_ADDRESS, we are not calling

br_stp_change_bridge_id(), which leads to incorrect local fdb
management and bridge id calculation, and prevents us from receiving
frames on the bridge device.

Reported-by: Tom Gundersen t...@jklm.no

Signed-off-by: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
Signed-off-by: David S. Miller da...@davemloft.net
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-06-05 Thread Tom Gundersen
Thanks for the reminder. I'll revert the revert :)

We grew some more features since it was first introduced, so will have
to check out how it all works with tunnels, veth devices etc, but
should definitely have this back for 314.

Cheers,

Tom

On Thu, Jun 5, 2014 at 12:00 PM, poma pomidorabelis...@gmail.com wrote:

 Bridgetto is in the stable 3.14.5 kernel.

 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=4a68caa
 https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.14.5
 .
 commit 4a68caa1b3d3f382bde56a6a3d3430bcb53ecf7f
 Author: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
 Date:   Fri Apr 25 17:01:18 2014 +0900

 bridge: Handle IFLA_ADDRESS correctly when creating bridge device
 [ Upstream commit 30313a3d5794472c3548d7288e306a5492030370 ]
 When bridge device is created with IFLA_ADDRESS, we are not calling
 br_stp_change_bridge_id(), which leads to incorrect local fdb
 management and bridge id calculation, and prevents us from receiving
 frames on the bridge device.
 Reported-by: Tom Gundersen t...@jklm.no
 Signed-off-by: Toshiaki Makita makita.toshi...@lab.ntt.co.jp
 Signed-off-by: David S. Miller da...@davemloft.net
 Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


 poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread Matthias Schiffer
 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.

 Cheers,

 Tom

 
 For my usecase, a predictable, but otherwise random MAC address would
 do. But I also see that setting an arbitrary MAC address (or any other
 link parameter) for a specific virtual device is useful as well
 (especially as it is possible to do so with real devices). As virtual
 devices are almost always created with specific names, a Name= match for
 .link units would make the most sense in my opinion.
 
 As a workaround, I've added the following udev rule to
 80-net-setup-link.rules for now to allow matching for virtual devices
 with Path= matches:
 
 ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
 ENV{ID_PATH}=virtual-$kernel
 
 Thanks,
 Matthias
 

Ping. There is still no way to match for virtual devices in .link units
without my workaround. Is it planned to add something similar? Would a
facility allowing to configure the MAC address of a virtual device be in
the scope of the TODO point add reduced [Link] support to .network files?



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread Tom Gundersen
On Mon, May 12, 2014 at 10:43 AM, Matthias Schiffer
mschif...@universe-factory.net wrote:
 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.

 Cheers,

 Tom


 For my usecase, a predictable, but otherwise random MAC address would
 do. But I also see that setting an arbitrary MAC address (or any other
 link parameter) for a specific virtual device is useful as well
 (especially as it is possible to do so with real devices). As virtual
 devices are almost always created with specific names, a Name= match for
 .link units would make the most sense in my opinion.

 As a workaround, I've added the following udev rule to
 80-net-setup-link.rules for now to allow matching for virtual devices
 with Path= matches:

 ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
 ENV{ID_PATH}=virtual-$kernel

 Thanks,
 Matthias


 Ping. There is still no way to match for virtual devices in .link units
 without my workaround. Is it planned to add something similar? Would a
 facility allowing to configure the MAC address of a virtual device be in
 the scope of the TODO point add reduced [Link] support to .network files?

Yes. What we will do is that by default we will generate a MAC address
that will be stable between reboots and use that, but we will also
allow the MAC address to be set manually in the [NetDev] section (in
the same way as in the .link files).

The kernel interface for doing this is currently broken, but a patch
has been submitted to fix it, and once that hits the stable kernels I
guess we can start using it (otherwise we are just going to get heaps
of weird bug reports).

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread poma
On 12.05.2014 12:22, Tom Gundersen wrote:
 On Mon, May 12, 2014 at 10:43 AM, Matthias Schiffer
 mschif...@universe-factory.net wrote:
 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.

 Cheers,

 Tom


 For my usecase, a predictable, but otherwise random MAC address would
 do. But I also see that setting an arbitrary MAC address (or any other
 link parameter) for a specific virtual device is useful as well
 (especially as it is possible to do so with real devices). As virtual
 devices are almost always created with specific names, a Name= match for
 .link units would make the most sense in my opinion.

 As a workaround, I've added the following udev rule to
 80-net-setup-link.rules for now to allow matching for virtual devices
 with Path= matches:

 ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
 ENV{ID_PATH}=virtual-$kernel

 Thanks,
 Matthias


 Ping. There is still no way to match for virtual devices in .link units
 without my workaround. Is it planned to add something similar? Would a
 facility allowing to configure the MAC address of a virtual device be in
 the scope of the TODO point add reduced [Link] support to .network files?
 
 Yes. What we will do is that by default we will generate a MAC address
 that will be stable between reboots and use that, but we will also
 allow the MAC address to be set manually in the [NetDev] section (in
 the same way as in the .link files).
 
 The kernel interface for doing this is currently broken, but a patch
 has been submitted to fix it, and once that hits the stable kernels I
 guess we can start using it (otherwise we are just going to get heaps
 of weird bug reports).
 
 Cheers,
 
 Tom

Ping.
Care to paste link to a patch?


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread Tom Gundersen
On Mon, May 12, 2014 at 5:27 PM, poma pomidorabelis...@gmail.com wrote:
 On 12.05.2014 12:22, Tom Gundersen wrote:
 On Mon, May 12, 2014 at 10:43 AM, Matthias Schiffer
 mschif...@universe-factory.net wrote:
 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.

 Cheers,

 Tom


 For my usecase, a predictable, but otherwise random MAC address would
 do. But I also see that setting an arbitrary MAC address (or any other
 link parameter) for a specific virtual device is useful as well
 (especially as it is possible to do so with real devices). As virtual
 devices are almost always created with specific names, a Name= match for
 .link units would make the most sense in my opinion.

 As a workaround, I've added the following udev rule to
 80-net-setup-link.rules for now to allow matching for virtual devices
 with Path= matches:

 ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
 ENV{ID_PATH}=virtual-$kernel

 Thanks,
 Matthias


 Ping. There is still no way to match for virtual devices in .link units
 without my workaround. Is it planned to add something similar? Would a
 facility allowing to configure the MAC address of a virtual device be in
 the scope of the TODO point add reduced [Link] support to .network files?

 Yes. What we will do is that by default we will generate a MAC address
 that will be stable between reboots and use that, but we will also
 allow the MAC address to be set manually in the [NetDev] section (in
 the same way as in the .link files).

 The kernel interface for doing this is currently broken, but a patch
 has been submitted to fix it, and once that hits the stable kernels I
 guess we can start using it (otherwise we are just going to get heaps
 of weird bug reports).

 Cheers,

 Tom

 Ping.
 Care to paste link to a patch?

Sure: http://www.spinics.net/lists/netdev/msg280477.html

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread poma
On 05/12/2014 05:45 PM, Tom Gundersen wrote:
 On Mon, May 12, 2014 at 5:27 PM, poma pomidorabelis...@gmail.com wrote:
 On 12.05.2014 12:22, Tom Gundersen wrote:
 On Mon, May 12, 2014 at 10:43 AM, Matthias Schiffer
 mschif...@universe-factory.net wrote:
 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.

 Cheers,

 Tom


 For my usecase, a predictable, but otherwise random MAC address would
 do. But I also see that setting an arbitrary MAC address (or any other
 link parameter) for a specific virtual device is useful as well
 (especially as it is possible to do so with real devices). As virtual
 devices are almost always created with specific names, a Name= match for
 .link units would make the most sense in my opinion.

 As a workaround, I've added the following udev rule to
 80-net-setup-link.rules for now to allow matching for virtual devices
 with Path= matches:

 ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
 ENV{ID_PATH}=virtual-$kernel

 Thanks,
 Matthias


 Ping. There is still no way to match for virtual devices in .link units
 without my workaround. Is it planned to add something similar? Would a
 facility allowing to configure the MAC address of a virtual device be in
 the scope of the TODO point add reduced [Link] support to .network files?

 Yes. What we will do is that by default we will generate a MAC address
 that will be stable between reboots and use that, but we will also
 allow the MAC address to be set manually in the [NetDev] section (in
 the same way as in the .link files).

 The kernel interface for doing this is currently broken, but a patch
 has been submitted to fix it, and once that hits the stable kernels I
 guess we can start using it (otherwise we are just going to get heaps
 of weird bug reports).

 Cheers,

 Tom

 Ping.
 Care to paste link to a patch?
 
 Sure: http://www.spinics.net/lists/netdev/msg280477.html
 
 Cheers,
 
 Tom
 

Thanks!
Why am I seeing this commit on git/stable, 
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/net/bridge/br_netlink.c?id=30313a3
but not in stable complete tarball, 
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.3.tar.xz


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread poma
On 12.05.2014 20:53, Tom Gundersen wrote:
 On Mon, May 12, 2014 at 7:44 PM, poma pomidorabelis...@gmail.com wrote:
 Why am I seeing this commit on git/stable,
 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/net/bridge/br_netlink.c?id=30313a3
 but not in stable complete tarball,
 https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.3.tar.xz
 
 You are seeing it in the 'master' branch, which is just tracking
 Linus' tree. It has not yet been backported to any of the stable
 branches.
 
 Cheers,
 
 Tom
 

Ooh yeah!
br_netlink.c?h=master vs. br_netlink.c?h=linux-3.14.y
Thanks!


poma


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-22 Thread Tom Gundersen
Hi Matthias,

On Fri, Apr 18, 2014 at 1:08 AM, Matthias Schiffer
mschif...@universe-factory.net wrote:
 On 04/18/2014 12:14 AM, Matthias Schiffer wrote:
 On 04/17/2014 11:28 PM, Dave Reisner wrote:
 On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
 Hi,
 I'd like to configure the MAC address of a bridge device statically (as
 bridges tend to change their MAC address depending on the order the
 ports are added on Linux otherwise), but there doesn't seem to be a way
 to match for a bridge in a .link unit. This would be very useful for
 macvlans as well.

 Link files can match bridges generally with Type=bridge or Driver=bridge
 in the [Match] section, or more specifically by just matching on name.
 In the [Link] section, MACAddressPolicy=persistent should give you
 persistent hw addresses in the general case, or you can use
 MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
 matches.

 Does this not work for you?
 Hmm, I thought I tried that before, but using
 MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
 Name= match is not documented in the systemd.link manpage.

 I have to correct myself: The Name= match does not exist for .link
 units. My testcase just seemed to work as a [Match] section only
 consisting of a Name= match was considered an empty [Match] section and
 matched on all devices...

 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.

So I think what we should do here is to allow MAC address (and other
things) to be set when creating the netdevs. I made an attempt at this
by generating a predictable one based on the interface name and the
machine-id. Would that do it for you, or are you after a _specific_
mac address, rather than just one that is always the same? I had to
revert the code doing this for now as there was a kernel bug, however
we'll hopefully get that sorted soon and then get back to this.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-22 Thread Matthias Schiffer
On 04/22/2014 04:07 PM, Tom Gundersen wrote:
 Hi Matthias,
 
 On Fri, Apr 18, 2014 at 1:08 AM, Matthias Schiffer
 mschif...@universe-factory.net wrote:
 On 04/18/2014 12:14 AM, Matthias Schiffer wrote:
 On 04/17/2014 11:28 PM, Dave Reisner wrote:
 On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
 Hi,
 I'd like to configure the MAC address of a bridge device statically (as
 bridges tend to change their MAC address depending on the order the
 ports are added on Linux otherwise), but there doesn't seem to be a way
 to match for a bridge in a .link unit. This would be very useful for
 macvlans as well.

 Link files can match bridges generally with Type=bridge or Driver=bridge
 in the [Match] section, or more specifically by just matching on name.
 In the [Link] section, MACAddressPolicy=persistent should give you
 persistent hw addresses in the general case, or you can use
 MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
 matches.

 Does this not work for you?
 Hmm, I thought I tried that before, but using
 MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
 Name= match is not documented in the systemd.link manpage.

 I have to correct myself: The Name= match does not exist for .link
 units. My testcase just seemed to work as a [Match] section only
 consisting of a Name= match was considered an empty [Match] section and
 matched on all devices...

 This should really be added as AFAICT there is currently no way to match
 on virtual devices like briges, TAP devices, batman-adv devices, etc...
 which have neither a persistent MAC address nor an ID_PATH to match on.
 
 So I think what we should do here is to allow MAC address (and other
 things) to be set when creating the netdevs. I made an attempt at this
 by generating a predictable one based on the interface name and the
 machine-id. Would that do it for you, or are you after a _specific_
 mac address, rather than just one that is always the same? I had to
 revert the code doing this for now as there was a kernel bug, however
 we'll hopefully get that sorted soon and then get back to this.
 
 Cheers,
 
 Tom
 

For my usecase, a predictable, but otherwise random MAC address would
do. But I also see that setting an arbitrary MAC address (or any other
link parameter) for a specific virtual device is useful as well
(especially as it is possible to do so with real devices). As virtual
devices are almost always created with specific names, a Name= match for
.link units would make the most sense in my opinion.

As a workaround, I've added the following udev rule to
80-net-setup-link.rules for now to allow matching for virtual devices
with Path= matches:

ENV{DEVPATH}==/devices/virtual/net/*, ENV{ID_PATH}==,
ENV{ID_PATH}=virtual-$kernel

Thanks,
Matthias



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
Hi,
I'd like to configure the MAC address of a bridge device statically (as
bridges tend to change their MAC address depending on the order the
ports are added on Linux otherwise), but there doesn't seem to be a way
to match for a bridge in a .link unit. This would be very useful for
macvlans as well.

Am I missing something? If not, it would be great if such a feature
could be added, either by providing a way to match for such netdevs in a
.link unit, or just by allowing a [Link] section in the .netdev unit
(which would be more concise in my opinion).

Thanks,
Matthias



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Dave Reisner
On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
 Hi,
 I'd like to configure the MAC address of a bridge device statically (as
 bridges tend to change their MAC address depending on the order the
 ports are added on Linux otherwise), but there doesn't seem to be a way
 to match for a bridge in a .link unit. This would be very useful for
 macvlans as well.

Link files can match bridges generally with Type=bridge or Driver=bridge
in the [Match] section, or more specifically by just matching on name.
In the [Link] section, MACAddressPolicy=persistent should give you
persistent hw addresses in the general case, or you can use
MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
matches.

Does this not work for you?

 Am I missing something? If not, it would be great if such a feature
 could be added, either by providing a way to match for such netdevs in a
 .link unit, or just by allowing a [Link] section in the .netdev unit
 (which would be more concise in my opinion).
 
 Thanks,
 Matthias
 



 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
On 04/17/2014 11:28 PM, Dave Reisner wrote:
 On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
 Hi,
 I'd like to configure the MAC address of a bridge device statically (as
 bridges tend to change their MAC address depending on the order the
 ports are added on Linux otherwise), but there doesn't seem to be a way
 to match for a bridge in a .link unit. This would be very useful for
 macvlans as well.
 
 Link files can match bridges generally with Type=bridge or Driver=bridge
 in the [Match] section, or more specifically by just matching on name.
 In the [Link] section, MACAddressPolicy=persistent should give you
 persistent hw addresses in the general case, or you can use
 MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
 matches.
 
 Does this not work for you?
Hmm, I thought I tried that before, but using
MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
Name= match is not documented in the systemd.link manpage.

MACAddressPolicy=persistent doesn't seem to have an effect on bridge
devices though (with systemd 212), but I don't rely on that anyways.

 
 Am I missing something? If not, it would be great if such a feature
 could be added, either by providing a way to match for such netdevs in a
 .link unit, or just by allowing a [Link] section in the .netdev unit
 (which would be more concise in my opinion).

 Thanks,
 Matthias

 
 
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
On 04/18/2014 12:14 AM, Matthias Schiffer wrote:
 On 04/17/2014 11:28 PM, Dave Reisner wrote:
 On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
 Hi,
 I'd like to configure the MAC address of a bridge device statically (as
 bridges tend to change their MAC address depending on the order the
 ports are added on Linux otherwise), but there doesn't seem to be a way
 to match for a bridge in a .link unit. This would be very useful for
 macvlans as well.

 Link files can match bridges generally with Type=bridge or Driver=bridge
 in the [Match] section, or more specifically by just matching on name.
 In the [Link] section, MACAddressPolicy=persistent should give you
 persistent hw addresses in the general case, or you can use
 MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
 matches.

 Does this not work for you?
 Hmm, I thought I tried that before, but using
 MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
 Name= match is not documented in the systemd.link manpage.

I have to correct myself: The Name= match does not exist for .link
units. My testcase just seemed to work as a [Match] section only
consisting of a Name= match was considered an empty [Match] section and
matched on all devices...

This should really be added as AFAICT there is currently no way to match
on virtual devices like briges, TAP devices, batman-adv devices, etc...
which have neither a persistent MAC address nor an ID_PATH to match on.

 
 MACAddressPolicy=persistent doesn't seem to have an effect on bridge
 devices though (with systemd 212), but I don't rely on that anyways.
 

 Am I missing something? If not, it would be great if such a feature
 could be added, either by providing a way to match for such netdevs in a
 .link unit, or just by allowing a [Link] section in the .netdev unit
 (which would be more concise in my opinion).

 Thanks,
 Matthias




 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

 
 
 
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel