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}` fi - 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} ${SETMTU} # 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
Added as of initscripts-5.02-1.
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} fi
I verified that this was fine in 7.0.
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
well this little patch seems to fix it... 91a92,95 > if [ -n "${MTU}" ]; then > ifconfig ${DEVICE} mtu ${MTU} > fi > 152c156 < --- >
Fixed in CVS, will be in 5.93-1 or later.