Project

General

Profile

Bug #4397

MTU must be set in same ifconfig command as IP

Added by Chris Buechler over 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
High
Category:
Interfaces
Target version:
Start date:
02/09/2015
Due date:
% Done:

100%

Estimated time:
Affected Version:
All
Affected Architecture:

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.

Associated revisions

Revision 1ac5261f (diff)
Added by Ermal Luçi over 4 years ago

Fixes #4397 Make mtu configuration before the ip address assignment. This fixes the issues of link routes having the wrong mtu configured on them.

Revision afb38815 (diff)
Added by Ermal Luçi over 4 years ago

Fixes #4397 Make mtu configuration before the ip address assignment. This fixes the issues of link routes having the wrong mtu configured on them.

History

#1 Updated by Ermal Luçi over 4 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.

#2 Updated by Ermal Luçi over 4 years ago

  • % Done changed from 0 to 100

#3 Updated by Ermal Luçi over 4 years ago

#4 Updated by Chris Buechler over 4 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.

#5 Updated by Ermal Luçi about 4 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

#6 Updated by Chris Buechler about 4 years ago

  • Target version changed from 2.2.1 to 2.2.2

#7 Updated by Chris Buechler about 4 years ago

  • Target version changed from 2.2.2 to 2.2.3

#8 Updated by Ermal Luçi about 4 years ago

  • Status changed from Confirmed to Feedback

This should work as expected on newer versions.

#9 Updated by Chris Buechler almost 4 years ago

  • Target version changed from 2.2.3 to 2.3

#10 Updated by Jim Thompson over 3 years ago

  • Assignee changed from Ermal Luçi to Chris Buechler

reassigned to cmb

#11 Updated by Chris Buechler over 3 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.

Also available in: Atom PDF