Page MenuHomeVyOS Platform

VLAN: error on commit if main interface is disabled
Closed, ResolvedPublicBUG

Description

Create VLAN interfaces

set interfaces ethernet eth1 vif 5 address '192.0.2.1/28'
set interfaces ethernet eth1 vif 5 address '2001:db8:0:::ffff/64'
set interfaces ethernet eth1 vif 10 address '192.0.2.17/28'
set interfaces ethernet eth1 vif 10 address '2001:db8:1:ffff/64'
commit

Disable pyhsical interface

set interfaces ethernet eth1 disable
commit
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 437, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 428, in apply
    apply_vlan_config(vlan, vif)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig_vlan.py", line 77, in apply_vlan_config
    vlan.set_admin_state('up')
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 557, in set_admin_state
    return self.set_interface('admin_state', state)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 154, in set_interface
    return self._set_command(self.config, name, value)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 82, in _set_command
    return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd))
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 48, in _cmd
    return cmd(command, self.debug)
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 139, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: ip link set dev eth0.5 up
returned:
exit code: 2

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

jjakob added subscribers: thomas-mangin, jjakob.

@thomas-mangin there was a bug in PR #383 that prevented bond interfaces from coming up - it thought the members had addresses assigned, but they didn't. Something in my PR#384 fixed it - I'm not exactly sure what - probably assigning the intf['intf'] in get_intf_from_dict or fixing the _basename function. There is still a bug with IPv6 link-locals that worked fine before - I'll see if it's easy to track down, if not I'll open a new task for it.

Why do we need to remove all addresses from the interface when it is disabled? That causes a commit error on dhcp:

vyos@vyos# set service dhcp-server disable 
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# delet service dhcp-server disable 
[edit]
vyos@vyos# commit
[ service dhcp-server ]
DHCP server configuration error!
None of configured DHCP subnets does not have appropriate
primary IP address on any broadcast interface.

[[service dhcp-server]] failed
Commit failed
[edit]

Also the running service logs errors, but dhcpd seems to handle them gracefully and doesn't die:
vyos dhcpd[7765]: receive_packet failed on bond0: Network is down

If you agree, I'll change it back to the way it was when disable just sets the interface admin down.

Why do we need to remove all addresses from the interface when it is disabled?

It was a misunderstanding on my side of what disable should do.

Since the issue is resolved can this be closed?

erkin set Issue type to Bug (incorrect behavior).Aug 30 2021, 6:36 AM
erkin removed a subscriber: Active contributors.