Project

General

Profile

Actions

Bug #4397

closed

MTU must be set in same ifconfig command as IP

Added by Chris Buechler almost 10 years ago. Updated about 9 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:
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.

Actions #1

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.

Actions #2

Updated by Ermal Luçi almost 10 years ago

  • % Done changed from 0 to 100
Actions #3

Updated by Ermal Luçi almost 10 years ago

Actions #4

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.

Actions #5

Updated by Ermal Luçi almost 10 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

Actions #6

Updated by Chris Buechler almost 10 years ago

  • Target version changed from 2.2.1 to 2.2.2
Actions #7

Updated by Chris Buechler over 9 years ago

  • Target version changed from 2.2.2 to 2.2.3
Actions #8

Updated by Ermal Luçi over 9 years ago

  • Status changed from Confirmed to Feedback

This should work as expected on newer versions.

Actions #9

Updated by Chris Buechler over 9 years ago

  • Target version changed from 2.2.3 to 2.3
Actions #10

Updated by Jim Thompson over 9 years ago

  • Assignee changed from Ermal Luçi to Chris Buechler

reassigned to cmb

Actions #11

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.

Actions

Also available in: Atom PDF