From 29b0ee30bf2622a40ca3d17e3f6b9e94e5b62072 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Mon, 1 Aug 2022 13:19:53 +0000 Subject: mtu: T4572: Add DHCP-option MTU to get values from DHCP-server Ability to get MTU from DHCP-server and don't touch it per any interface change if interface 'dhcp-options mtu' is configured --- interface-definitions/include/interface/dhcp-options.xml.i | 6 ++++++ python/vyos/ifconfig/interface.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/interface-definitions/include/interface/dhcp-options.xml.i b/interface-definitions/include/interface/dhcp-options.xml.i index 914b60503..2ed5fd403 100644 --- a/interface-definitions/include/interface/dhcp-options.xml.i +++ b/interface-definitions/include/interface/dhcp-options.xml.i @@ -14,6 +14,12 @@ Override system host-name sent to DHCP server + + + Use MTU value from DHCP server - ignore interface setting + + + Identify the vendor client type to the DHCP server diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 555494f80..c50ead89f 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1535,7 +1535,7 @@ class Interface(Control): # before mangling any IPv6 option. If MTU is less then 1280 IPv6 will be # automatically disabled by the kernel. Also MTU must be increased before # configuring any IPv6 address on the interface. - if 'mtu' in config: + if 'mtu' in config and dict_search('dhcp_options.mtu', config) == None: self.set_mtu(config.get('mtu')) # Configure MSS value for IPv6 TCP connections -- cgit v1.2.3