Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 9624 - Should be able to set MTU via ifcfg-ethX file
Should be able to set MTU via ifcfg-ethX file
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-02-21 01:56 EST by Dave O'Neill
Modified: 2014-03-16 22:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-06-05 20:32:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave O'Neill 2000-02-21 01:56:19 EST
It would be nice to be able to set the MTU for an interface via the
appropriate ifup-XXXX file in /etc/sysconfig/network-scripts.   The patch
below allows setting of the MTU with 'MTU=nnnn' in said file.

--- ifup.old    Sun Apr 18 19:36:47 1999
+++ ifup        Fri Oct 15 20:11:03 1999
@@ -102,7 +102,13 @@
        eval `/bin/ipcalc --network ${IPADDR} ${NETMASK}`

-    ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
+    if [ "foo$MTU" != "foo" ]; then
+               SETMTU="mtu $MTU"
+       else
+               SETMTU=""
+    fi
+    ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
     # don't re-add subnet route on 2.2 kernels, but add a route
     # to a non-local subnet.
     # stupid hack, but it should work
Comment 1 Bill Nottingham 2000-03-20 11:20:59 EST
Added as of initscripts-5.02-1.
Comment 2 Thornton Prime 2001-05-29 15:37:16 EDT
Has this bug resurfaced in 7.1?

The new ifup script has:

153:ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST} \
$(toggle_value arp $ARP) \
$(toggle_value promisc $PROMISC) \
$(toggle_value allmulti $ALLMULTI)

It only reads and sets MTU if interface does not specify IP:

135:if [ -z "${IPADDR}" ]; then
# enable device without IP, useful for e.g. PPPoE
ifconfig ${DEVICE} up ${MTU:+mtu $MTU}
exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}

Comment 3 Thornton Prime 2001-05-29 15:41:29 EDT
I verified that this was fine in 7.0.
Comment 4 Mike Gahagan 2001-06-05 20:14:40 EDT
Yes this bug does exist in 7.1, to reproduce, simply add an MTU=xxx line in /etc/sysconfig/network-scripts/ifcfg-ethx then restart the network, you will see that after running ifconfig that the MTU is still set to the old value where 'ifconfig ethx mtu 1300' on the command line will change the MTU on the running interface
Comment 5 Mike Gahagan 2001-06-05 20:32:29 EDT
well this little patch seems to fix it...

> if [ -n "${MTU}" ]; then
>    ifconfig ${DEVICE} mtu ${MTU}
> fi

Comment 6 Bill Nottingham 2001-06-22 11:20:05 EDT
Fixed in CVS, will be in 5.93-1 or later.

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