Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: bridge-ports should be allowed to be empty (or even non-existent maybe?) if bridge-always-up is on #297

Open
greyltc opened this issue Apr 17, 2024 · 5 comments

Comments

@greyltc
Copy link

greyltc commented Apr 17, 2024

for example, it would be neat if a config like this worked:

auto vmbr0
iface vmbr0 inet static
        address 192.168.1.2/24
        gateway 192.168.1.1
        bridge-ports
        bridge-always-up on
        bridge-stp off
        bridge-fd 0

the bridge-always-up on directive should create a dummy interface and add it to the bridge (even when there are no other ports bridged)

@julienfortin
Copy link
Contributor

@greyltc bridge-ports none should work in your case

@greyltc
Copy link
Author

greyltc commented Apr 18, 2024

thanks @julienfortin! I think I tried a similar thing with bridge-ports null

anyway, do you think

2024-04-17 19:25:20,713: MainThread: ifupdown.bridge: bridge.py:2784:up_bridge(): warning: vmbr0: apply bridge ports settings: 'NoneType' object has no attribute 'append'

in the below debug log is anything to worry about?

2024-04-17 19:25:20,700: MainThread: ifupdown2.NetlinkListenerWithCache: nlcache.py:2882:link_add_bridge(): info: vmbr0: netlink: ip link add dev vmbr0 type bridge
2024-04-17 19:25:20,703: MainThread: ifupdown.bridge: bridge.py:1555:up_apply_bridge_settings(): info: vmbr0: applying bridge settings
2024-04-17 19:25:20,703: MainThread: ifupdown.bridge: bridge.py:1547:fill_ifla_info_data_with_ifla_br_attribute(): info: vmbr0: set bridge-fd 0
2024-04-17 19:25:20,703: MainThread: ifupdown.bridge: bridge.py:1547:fill_ifla_info_data_with_ifla_br_attribute(): info: vmbr0: set bridge-mcsnoop yes
2024-04-17 19:25:20,703: MainThread: ifupdown.bridge: modulebase.py:317:read_file_oneline(): info: reading '/sys/class/net/vmbr0/bridge/stp_state'
2024-04-17 19:25:20,703: MainThread: ifupdown2.NetlinkListenerWithCache: nlcache.py:2906:link_set_bridge_info_data(): info: vmbr0: netlink: ip link set dev vmbr0 type bridge (with attributes)
2024-04-17 19:25:20,703: MainThread: ifupdown2.NetlinkListenerWithCache: nlcache.py:2910:link_set_bridge_info_data(): debug: attributes: {1: 0, 23: True}
2024-04-17 19:25:20,704: MainThread: ifupdown.bridge: bridge.py:1342:bridge_always_up(): info: vmbr0: bridge-always-up yes: enslaving dummy port: brport-if2
2024-04-17 19:25:20,704: MainThread: ifupdown2.NetlinkListenerWithCache: nlcache.py:2546:link_add_with_attributes(): info: brport-if2: netlink: ip link add dev brport-if2 type dummy
2024-04-17 19:25:20,713: MainThread: ifupdown2.NetlinkListenerWithCache: nlcache.py:2610:link_up_force(): info: brport-if2: netlink: ip link set dev brport-if2 up
2024-04-17 19:25:20,713: MainThread: ifupdown.bridge: bridge.py:2784:up_bridge(): warning: vmbr0: apply bridge ports settings: 'NoneType' object has no attribute 'append'
2024-04-17 19:25:20,714: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module bridgevlan
2024-04-17 19:25:20,714: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module tunnel
2024-04-17 19:25:20,715: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module vrf
2024-04-17 19:25:20,715: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module ethtool
2024-04-17 19:25:20,715: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module auto
2024-04-17 19:25:20,715: MainThread: ifupdown: scheduler.py:105:run_iface_op(): debug: vmbr0: pre-up : running module address

brport-if2 gets created but doesn't make it into the bridge

$ ip -d link show brport-if2
4: brport-if2: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether ba:dc:0f:fe:e0:dd brd ff:ff:ff:ff:ff:ff promiscuity 0  allmulti 0 minmtu 0 maxmtu 0 
    dummy addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
$ brctl show | grep 'brport-if2'
# crickets chirping

@julienfortin
Copy link
Contributor

Maybe bridge-ports none doesn't work anymore
Have you tried adding a dummy interface a bridge ports instead?

@greyltc
Copy link
Author

greyltc commented Apr 18, 2024

Have you tried adding a dummy interface a bridge ports instead?

Yes. Isn't that what the bridge-always-up on directive is meant to do?

@greyltc
Copy link
Author

greyltc commented Apr 18, 2024

I've made an untested pull request in #298 which I hope will solve the 'NoneType' object has no attribute 'append' we've seen here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants