summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-01-12 16:37:13 +0200
committerNataliia Solomko <natalirs1985@gmail.com>2026-01-21 15:07:14 +0200
commitf8a68122f3b4738a2a1bd1526ed3c9b8961d050d (patch)
treeee495630f8b3f6687a546b7064f313b4c9f429f9 /src
parent7fea6b6dbbd786bf6a32c496fc70ca9e9b5f8b1f (diff)
downloadvyos-1x-f8a68122f3b4738a2a1bd1526ed3c9b8961d050d.tar.gz
vyos-1x-f8a68122f3b4738a2a1bd1526ed3c9b8961d050d.zip
vpp: T8125: Enable ip4-dhcp-client-detect feature if interface address is configured as DHCP
DHCP address cannot be assigned on VPP interfaces without enabling the 'ip4-dhcp-client-detect' feature
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_ethernet.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py
index 599421c72..ffb59c89e 100755
--- a/src/conf_mode/interfaces_ethernet.py
+++ b/src/conf_mode/interfaces_ethernet.py
@@ -447,17 +447,27 @@ def apply(ethernet):
if 'static_arp' in ethernet:
call_dependents()
- # If the interface is managed by the VPP DPDK driver, synchronize runtime
- # parameters between Linux and the corresponding VPP LCP interface
- if dict_search(f'vpp.settings.interface.{ifname}.driver', ethernet) == 'dpdk':
+ vpp_iface_config = dict_search(f'vpp.settings.interface.{ifname}', ethernet)
+ if vpp_iface_config and is_systemd_service_running('vpp.service'):
vpp_api = VPPControl()
- # Find LCP pair
- lcp_pair = vpp_api.lcp_pair_find(vpp_name_hw=ifname)
- lcp_name = lcp_pair.get('vpp_name_kernel')
- # Sync MTU to VPP LCP pair interface
- if lcp_name:
- mtu = e.get_mtu()
- vpp_api.set_iface_mtu(lcp_name, mtu)
+
+ # Enable ip4-dhcp-client-detect feature for DHCP-configured interfaces.
+ # This feature is required for VPP to process DHCP packets and assign addresses.
+ if 'dhcp' in ethernet.get('address', []):
+ vpp_api.enable_dhcp_client(ifname)
+ else:
+ vpp_api.disable_dhcp_client(ifname)
+
+ # If the interface is managed by the VPP DPDK driver, synchronize runtime
+ # parameters between Linux and the corresponding VPP LCP interface
+ if vpp_iface_config.get('driver') == 'dpdk':
+ # Find LCP pair
+ lcp_pair = vpp_api.lcp_pair_find(vpp_name_hw=ifname)
+ lcp_name = lcp_pair.get('vpp_name_kernel')
+ # Sync MTU to VPP LCP pair interface
+ if lcp_name:
+ mtu = e.get_mtu()
+ vpp_api.set_iface_mtu(lcp_name, mtu)
return None