summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_ethernet.py
diff options
context:
space:
mode:
authorDavid Vølker <david@voelker.dk>2026-06-01 08:09:06 +0200
committerChristian Breunig <christian@breunig.cc>2026-07-01 21:51:21 +0200
commit0d3ac22b95cef90e7c54ef823c00bb59b935c158 (patch)
treed4655b06e0c9976a5ecdeae87205e944e098c7b9 /src/conf_mode/interfaces_ethernet.py
parent063e007a5a8eac3bb9ad101206dc94734eeaa595 (diff)
downloadvyos-1x-0d3ac22b95cef90e7c54ef823c00bb59b935c158.tar.gz
vyos-1x-0d3ac22b95cef90e7c54ef823c00bb59b935c158.zip
firewall: T8761: re-introduce VRF interface names in generated firewall config
This change re-implements the intended behaviour from T4180 aswell as from T4506, it ensures that both the vrf-member interface aswell as the vrf itself is added as an oifname -> meaning that traffic traversing and originating from withing VyOS is matches outbound. Changes done by c-po: * re-sort dependency list to keep diff low * vyos.configdict.is_vrf_changed() should return early and not carry over the to-be return value * keep common coding style (dict by . separation) in nftables-zone.j2 Co-authored-by: Christian Breunig <christian@breunig.cc>
Diffstat (limited to 'src/conf_mode/interfaces_ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces_ethernet.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py
index 3b8453780..1368f2c6e 100755
--- a/src/conf_mode/interfaces_ethernet.py
+++ b/src/conf_mode/interfaces_ethernet.py
@@ -24,6 +24,7 @@ from vyos.configdep import set_dependents
from vyos.configdep import call_dependents
from vyos.configdict import get_interface_dict
from vyos.configdict import is_node_changed
+from vyos.configdict import is_vrf_changed
from vyos.configdict import get_flowtable_interfaces
from vyos.configverify import verify_address
from vyos.configverify import verify_dhcpv6
@@ -196,6 +197,10 @@ def get_config(config=None):
if 'static_arp' in ethernet:
set_dependents('static_arp', conf)
+ # Check vrf membership, to ensure firewall is updated
+ if is_vrf_changed(conf, ifname):
+ set_dependents('firewall', conf)
+
return ethernet
def verify_speed_duplex(ethernet: dict, ethtool: Ethtool):
@@ -442,8 +447,9 @@ def apply(ethernet):
e.remove()
else:
e.update(ethernet)
- if 'static_arp' in ethernet:
- call_dependents()
+
+ # run the dependents
+ call_dependents()
vpp_iface_config = dict_search(f'vpp.settings.interface.{ifname}', ethernet)
if vpp_iface_config is not None and is_systemd_service_running('vpp.service'):