Support configurable interface MTUs
MTUs were hardcoded at 9000, which breaks if the underlying interface or network switch does not support jumbo frames, a possible deployment limitation. This has non-obvious consequences due to MTU mismatches for certain services (Ceph, Zookeeper, etc.). This commit adds support for configurable MTUs for each interface, set in pvcd.yaml. The example has been updated to reflect this, with a default of 1500 (the Ethernet standard). This commit also adds autoconfiguration of the VNI device MTU based on the `vni_mtu` value, the same for bridge networks and minus 50 (rather than 200 from the hardcoded value, based on the following resource [1]) for VXLAN networks. [1] http://ipengineer.net/2014/06/vxlan-mtu-vs-ip-mtu-consideration/
This commit is contained in:
@ -437,14 +437,18 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out
|
||||
self.vlan_nic
|
||||
)
|
||||
)
|
||||
|
||||
vx_mtu = self.config.vni_mtu
|
||||
common.run_os_command(
|
||||
'ip link set {} mtu 8800 up'.format(
|
||||
self.vlan_nic
|
||||
'ip link set {} mtu {} up'.format(
|
||||
self.vlan_nic,
|
||||
vx_mtu
|
||||
)
|
||||
)
|
||||
common.run_os_command(
|
||||
'ip link set {} mtu 8800 up'.format(
|
||||
self.bridge_nic
|
||||
'ip link set {} mtu {} up'.format(
|
||||
self.bridge_nic,
|
||||
vx_mtu
|
||||
)
|
||||
)
|
||||
common.run_os_command(
|
||||
@ -481,14 +485,18 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out
|
||||
self.vxlan_nic
|
||||
)
|
||||
)
|
||||
|
||||
vx_mtu = self.config.vni_mtu - 50
|
||||
common.run_os_command(
|
||||
'ip link set {} mtu 8800 up'.format(
|
||||
self.vxlan_nic
|
||||
'ip link set {} mtu {} up'.format(
|
||||
self.vxlan_nic,
|
||||
vx_mtu
|
||||
)
|
||||
)
|
||||
common.run_os_command(
|
||||
'ip link set {} mtu 8800 up'.format(
|
||||
self.bridge_nic
|
||||
'ip link set {} mtu {} up'.format(
|
||||
self.bridge_nic,
|
||||
vx_mtu
|
||||
)
|
||||
)
|
||||
common.run_os_command(
|
||||
|
Reference in New Issue
Block a user