Hello folks,
As we developed our product we ended up sending information over broadcast in the IPv4 link local range, and our receiving snaps/programs were not getting the data sent over broadcast, even if capturing with tcpdump we would see the traffic reaching the device. Then after we manually added the route: ip route add broadcast 169.254.255.255 dev eth0 table local the programs started to receive the traffic correctly, unfortunately this was a temporary solution, as it wasn’t persistent.
We tried making it persistent, but since we are using Network manager snap, there is no apparent function for this on it (type broadcast):
Where as ip command does:
So, the question is if there is a recommended way of making it persistent, without our snap applying the route manually with network-control every time it starts ? (that is our current workaround).
Does the relevant network interface have address in 169.254/16 range? Have you enabled ipv4.link-local and set ipv4.method to link-local in Network Manager? AFAIU NM might not set the broadcast address if link-local isn’t explicitly enabled.
hey @mborzecki1 !
Does the relevant network interface have address in 169.254/16 range?
Yes
Have you enabled ipv4.link-local and set ipv4.method to link-local in Network Manager?
No, unfortunately that does not work for us as we have it as a secondary address, and a fixed link-local address ( not a generated one )
AFAIU NM might not set the broadcast address if link-local isn’t explicitly enabled.
Ohh that is good to know, I’ll try it though
Thanks.
@mborzecki1
I tried:
ipv4.link-local and ipv4.link-local enabled and since we want a fixed link local address and other secondary ones I get:
Error: Failed to modify connection 'port-a': ipv4.addresses: this property is not allowed for 'method=link-local'
So unfortunately this is not going to work for us
, any other ideas ?
I think I’m missing something. How are the addresses configured to begin with? Is all the configuration done through NM?
edit:
I tried the following:
$ nmcli connection add connection.interface-name ve1 ipv4.method manual ipv4.addresses 192.168.1.50/24 type 802-3-ethernet
$ nmcli connection modify ethernet-ve1 +ipv4.addresses 169.254.10.15/16
$ nmcli connection up ethernet-ve1
$ nmcli device show ve1
GENERAL.DEVICE: ve1
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 7A:A5:5E:19:B6:24
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: ethernet-ve1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/4
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 169.254.10.15/16
IP4.ADDRESS[2]: 192.168.1.50/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 101
IP4.ROUTE[2]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 101
IP6.ADDRESS[1]: fe80::fdd5:167c:817b:dd92/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
root@u1:~# ip a s dev ve1
4: ve1@ve2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 7a:a5:5e:19:b6:24 brd ff:ff:ff:ff:ff:ff
inet 169.254.10.15/16 brd 169.254.255.255 scope link noprefixroute ve1
valid_lft forever preferred_lft forever
inet 192.168.1.50/24 brd 192.168.1.255 scope global noprefixroute ve1
valid_lft forever preferred_lft forever
inet6 fe80::fdd5:167c:817b:dd92/64 scope link noprefixroute
valid_lft forever preferred_lft forever
root@u1:~# ip r s table local dev ve1
local 169.254.10.15 proto kernel scope host src 169.254.10.15
broadcast 169.254.255.255 proto kernel scope link src 169.254.10.15
local 192.168.1.50 proto kernel scope host src 192.168.1.50
broadcast 192.168.1.255 proto kernel scope link src 192.168.1.50
Clearly the broadcast address is set. I did not have to change anything in particular.
edit 2:
And with link local address
$ nmcli connection add connection.interface-name ve1 ipv4.method manual ipv4.addresses 192.168.1.50/24 type 802-3-ethernet
Connection 'ethernet-ve1' (e3bf4d68-e5d1-45d5-abc2-0597bdf901e1) successfully added.
$ nmcli connection modify ethernet-ve1 ipv4.link-local enabled
$ nmcli connection up ethernet-ve1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
$ nmcli device show ve1
GENERAL.DEVICE: ve1
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 7A:A5:5E:19:B6:24
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: ethernet-ve1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/6
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 169.254.229.246/16
IP4.ADDRESS[2]: 192.168.1.50/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 101
IP4.ROUTE[2]: dst = 224.0.0.0/4, nh = 0.0.0.0, mt = 101
IP4.ROUTE[3]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 101
IP6.ADDRESS[1]: fe80::fda5:aeac:f681:a869/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
and broadcast address is set:
$ ip a s dev ve1
4: ve1@ve2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 7a:a5:5e:19:b6:24 brd ff:ff:ff:ff:ff:ff
inet 169.254.229.246/16 brd 169.254.255.255 scope link noprefixroute ve1 <--- ######
valid_lft forever preferred_lft forever
inet 192.168.1.50/24 brd 192.168.1.255 scope global noprefixroute ve1
valid_lft forever preferred_lft forever
inet6 fe80::fda5:aeac:f681:a869/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Please share the output of:
snap list network-manager
Hey @mborzecki1,
Yes, we use NM to set thing on this profile
ipv4.method: manual
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: 169.254.254.2/32
ipv4.gateway: --
snap list network-manager
Name Version Rev Tracking Publisher Notes
network-manager 1.46.0-5 976 24/stable canonical✓ -
I did noticed that you have ipv4.link-local enabled and we do not, so after adding it this is what I saw:
sudo ip route show dev eth0 table local
broadcast 169.254.255.255 proto kernel scope link src 169.254.30.54
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet 169.254.254.2/32 scope link noprefixroute internal
valid_lft forever preferred_lft forever
inet 169.254.30.54/16 brd 169.254.255.255 scope link noprefixroute internal
valid_lft forever preferred_lft forever
So that seemed to have worked and it added another link-local address to it, but I think we can work with that. 
Thank you!