summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-08-01 17:06:49 +0200
committerGitHub <noreply@github.com>2022-08-01 17:06:49 +0200
commitb6bab8573a8df082494d2c0e4635b228f281d5c6 (patch)
tree12064fc7950be4c1030e1666b3201425d8a976e8
parent537fc205933b99d291a4e696cee392785ca964bc (diff)
parent29b0ee30bf2622a40ca3d17e3f6b9e94e5b62072 (diff)
downloadvyos-1x-b6bab8573a8df082494d2c0e4635b228f281d5c6.tar.gz
vyos-1x-b6bab8573a8df082494d2c0e4635b228f281d5c6.zip
Merge pull request #1452 from sever-sever/T4572
mtu: T4572: Add DHCP-option MTU to get values from DHCP-server
-rw-r--r--interface-definitions/include/interface/dhcp-options.xml.i6
-rw-r--r--python/vyos/ifconfig/interface.py2
2 files changed, 7 insertions, 1 deletions
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 @@
<help>Override system host-name sent to DHCP server</help>
</properties>
</leafNode>
+ <leafNode name="mtu">
+ <properties>
+ <help>Use MTU value from DHCP server - ignore interface setting</help>
+ <valueless/>
+ </properties>
+ </leafNode>
<leafNode name="vendor-class-id">
<properties>
<help>Identify the vendor client type to the DHCP server</help>
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