Bug 170884 - MTU of ethernet card can't be set before interface is up
MTU of ethernet card can't be set before interface is up
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
Blocks: 124226
  Show dependency treegraph
Reported: 2005-10-14 18:32 EDT by Sven Neuhaus
Modified: 2014-03-16 22:56 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-07 14:24:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
moves the MTU section further back (749 bytes, patch)
2005-10-14 18:34 EDT, Sven Neuhaus
no flags Details | Diff

  None (edit)
Description Sven Neuhaus 2005-10-14 18:32:42 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
In /etc/sysconfig/network-scripts/ifup-eth
if the MTU parameter is configured in
it will try to set the MTU with "ip link set dev ${DEVICE} mtu ${MTU}"
before the interface is up.
This fails with my Marvell GigE card (sk98lin driver, kernel 2.6.13-1.1526_FC4).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Add non-standard MTU to /etc/sysconfig/network-scripts/ifcfg-eth0
2. make sure eth0 currently has the standard MTU:
   ifconfig eth0 mtu 1500
3. cd /etc/sysconfig/network-scripts; ./ifdown eth0; echo down; ./ifup eth0; echo up; ifconfig eth0 | grep MTU

Actual Results:  I see this output:
SIOCSIFMTU: Invalid argument
          UP BROADCAST MULTICAST  MTU:1500  Metric:1

Expected Results:  This should have been the output if the MTU had been set without a problem:
          UP BROADCAST MULTICAST  MTU:9000  Metric:1

Additional info:

The fix (for me) is to move the section that sets the MTU behind the lines that set the interface to status "up".
Comment 1 Sven Neuhaus 2005-10-14 18:34:43 EDT
Created attachment 120007 [details]
moves the MTU section further back

this patch moves the "ip link set dev ${DEVICE} mtu ${MTU}"
behind the "ip link set dev ${REALDEVICE} up"
which fixes the problem for me.
Comment 2 Sven Neuhaus 2005-10-14 18:42:01 EDT
This bug would have been detected much sooner if the feature from bug 124226
(RFE: set MTU from system-config-network) had been implemented.
Comment 4 Sven Neuhaus 2005-11-03 05:23:41 EST
Do you see any problems with my patch?
Comment 5 Bill Nottingham 2005-11-03 12:15:54 EST
Theoretically, it might need a second stanza to handle DHCP, although I'd hope
that nothing needs MTU set to actually *get* a IP address.

I'm still curious is the 'inability to set MTU unless link is set up' is
something that's specific to a particular driver, or is defined behavior -
Comment 6 John W. Linville 2005-11-03 13:33:33 EST
I don't see anything to suggest that this is a generic problem.  The sk98lin 
driver looks like it might be enforcing such a requirement, but I don't know 
Since this is FC4, I would suggest using the skge driver instead of sk98lin if 
at all possible. 
Comment 7 Denis Ovsienko 2005-11-04 02:30:14 EST
In most cases I have met MTU can be changed while interface is down.
Comment 8 Bill Nottingham 2006-08-07 14:24:46 EDT
Closing this - this is best solved by fixing the driver to allow setting the MTU
in all cases.

Note You need to log in before you can comment on or make changes to this bug.