Bug #4397
closedMTU must be set in same ifconfig command as IP
100%
Description
Where MTU on an interface is user-defined, the ifconfig command that assigns the IP and IPv6 addresses must include the MTU. For instance, this:
ifconfig vmx1 mtu 9000 ifconfig vmx1 inet 192.168.1.1 netmask 255.255.255.0
You'll end up with the NIC at MTU 9000, but the link route for 192.168.1.0/24 will be 1500. Doesn't matter if the MTU is set before or after the IP, this is the case.
If you instead run:
ifconfig vmx1 inet 192.168.1.1 netmask 255.255.255.0 mtu 9000
Then both the interface and the link route have the correct MTU. This affects IPv6 the same way, with the same resolution.
Updated by Ermal Luçi almost 10 years ago
- Status changed from Confirmed to Feedback
I pushed a fix which make it work for me.
Can you please confirm?
Normally it is not necessary to have the mtu on the same line just the interface needs to be up from my testing.
Updated by Ermal Luçi almost 10 years ago
- % Done changed from 0 to 100
Applied in changeset 1ac5261fb0c96764526beb4d9928b9300094ac3e.
Updated by Ermal Luçi almost 10 years ago
Applied in changeset afb388159bc5a55d784404411ef1a7c7d22625a5.
Updated by Chris Buechler almost 10 years ago
- Status changed from Feedback to Confirmed
setting the MTU before setting the IP doesn't behave any differently. The MTU must be appended to the ifconfig command that sets the inet and inet6 addresses for this to work.
Updated by Ermal Luçi over 9 years ago
This should work as is on 2.2 in FreeBSD head it has been fixed with:
Finish r274175: do control plane MTU tracking. Update route MTU in case of ifnet MTU change. Add new RTF_FIXEDMTU to track explicitly specified MTU. Old behavior: ifconfig em0 mtu 1500->9000 -> all routes traversing em0 do not change MTU. User has to manually update all routes. ifconfig em0 mtu 9000->1500 -> all routes traversing em0 do not change MTU. However, if ip[6]_output finds route with rt_mtu > interface mtu, rt_mtu gets updated. New behavior: ifconfig em0 mtu 1500->9000 -> all interface routes in all fibs gets updated with new MTU unless RTF_FIXEDMTU flag set on them. ifconfig em0 mtu 9000->1500 -> all routes in all fibs gets updated with new MTU unless RTF_FIXEDMTU flag set on them AND rt_mtu is less than ifp mtu. route add ... -mtu XXX automatically sets RTF_FIXEDMTU flag. route change .. -mtu 0 automatically removes RTF_FIXEDMTU flag. PR: 194238 MFC after: 1 month CR: D1125
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.1 to 2.2.2
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.2 to 2.2.3
Updated by Ermal Luçi over 9 years ago
- Status changed from Confirmed to Feedback
This should work as expected on newer versions.
Updated by Chris Buechler over 9 years ago
- Target version changed from 2.2.3 to 2.3
Updated by Jim Thompson about 9 years ago
- Assignee changed from Ermal Luçi to Chris Buechler
reassigned to cmb
Updated by Chris Buechler about 9 years ago
- Status changed from Feedback to Resolved
The fix above noted in "do control plane MTU tracking" is in 2.3/10-STABLE and works, which fixes this.