macvlan device do not honor smaller mtu than physical device
0
votes
0
answers
278
views
I have a use case to create multiple MACVLAN devices from the same physical ethernet device. The requirement is also that some MACVLANs could offer jumbo packets (MTU=9215) and some disallow jumbo packets and support only small frames.
I kept MTU=9000 for the physical device, and created required MACVLAN device. Noticed that MACVLAN device by default got the MTU of 9000 and were also working fine with jumbo frames (tested via ping with jumbo packets).. but then post changing the MTU of the MACVLan to 1500, it kept on working fine with jumbo frames. Below example shows just one MACVLAN
`
$ ip link add K9AT9i1G2x link eth6 type macvlan mode bridge
$ ip link set dev K9AT9i1G2x mtu 1500
$ ip a
123: eth6: mtu 9000 qdisc mq state UP group default qlen 1000
link/ether 00:60:16:a6:90:3a brd ff:ff:ff:ff:ff:ff
inet6 fe80::260:16ff:fea6:903a/64 scope link
valid_lft forever preferred_lft forever
129: K9AT9i1G2x@eth6: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ba:c7:36:3f:9a:76 brd ff:ff:ff:ff:ff:ff
inet 192.168.15.40/21 scope global K9AT9i1G2x
valid_lft forever preferred_lft forever
inet6 fe80::b8c7:36ff:fe3f:9a76/64 scope link
valid_lft forever preferred_lft forever
`
Below ping worked, even though MTU of macvlan device is set to 1500 -
`
# ping -c 3 -M do -s 8972 192.168.15.40
PING 192.168.15.40 (192.168.15.40) 8972(9000) bytes of data.
8980 bytes from 192.168.15.40: icmp_seq=1 ttl=64 time=27.0 ms
8980 bytes from 192.168.15.40: icmp_seq=2 ttl=64 time=0.955 ms
8980 bytes from 192.168.15.40: icmp_seq=3 ttl=64 time=5.33 ms
--- 192.168.15.40 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.955/11.098/27.009/11.391 ms
`
Can somebody please suggest, how do I restrict only smaller packet transport in this case ?
Asked by Smash
(101 rep)
Jul 5, 2022, 06:46 AM