LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware Devs: Please add no-MTU setting for DHCP in rc.inet1 (https://www.linuxquestions.org/questions/slackware-14/slackware-devs-please-add-no-mtu-setting-for-dhcp-in-rc-inet1-811327/)

SiegeX 05-31-2010 01:53 PM

Slackware Devs: Please add no-MTU setting for DHCP in rc.inet1
 
Those of us who are unfortunate enough to rely on Comcast for broadband speed over 6Mbit have to deal with their nonsense policies from time to time. Well, one of those policies seems to be that they want to set our MTU to 576 bytes; breaking many network connections due to its ridiculously low size.
Code:

[root@maximus]$ /etc/rc.d/rc.inet1 eth0_restart
Polling for DHCP server on interface eth0:
dhcpcd: version 5.2.2 starting
dhcpcd: eth0: broadcasting for a lease
dhcpcd: eth0: offered 76.102.X.X from 68.87.X.X
dhcpcd: eth0: acknowledged 76.102.X.X from 68.87.X.X
dhcpcd: eth0: checking for 76.102.X.X
dhcpcd: eth0: leased 76.102.X.X for 3600 seconds
dhcpcd: eth0: MTU set to 576
dhcpcd: forking to background

In order to set my MTU to a reasonable value (1500), I attempted to use MTU[0]=1500 in rc.inet1.conf. However, I quickly learned this was not a valid solution since the check for MTU[$i] is called *before* the check for DHCP and thus my specified value is promptly overridden by my MTU-setting DHCP server.

I see two possible solutions for this problem by slightly altering rc.inet1:

1) Move the if [ ! "${MTU[$i]}" = "" ]; stanza all the way down, right before the else in else if [ "$DEBUG_ETH_UP" = "yes" ]. This way my user-defined setting will override the DHCP issued MTU, not the other way around as it currently stands.

2) Add [ "${DHCP_KEEPMTU[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -C mtu" to the list of DHCP option checks, much like you do for $DHCP_KEEPRESOLV.

Option #1 is 'cleaner' in that it doesn't require an extra variable, such as $DHCP_KEEPMTU, to achieve the desired effect. However, option #2 is more inline with how we currently tweak DHCP.

P.S.
A google for "comcast mtu 576" brings up many hits so it is not a problem with my configuration nor does it appear to be localized to my area.

ponce 05-31-2010 02:13 PM

maybe you can fix it also commenting an option in /etc/dhcpcd.conf: there was a few day ago, another user having a similar problem, it can be this fixes also your (the MTU remains at the default of 1500).

SiegeX 05-31-2010 03:07 PM

Thanks. I put back the original rc.inet1 and commented out #option interface_mtu in /etc/dhcpcd.conf as you suggested. But I wonder if it would still be prudent to add a $DHCP_KEEPMTU variable that one can set from rc.inet1.conf? If not, then I would propose that $DHCP_KEEPRESOLV be removed and instead this functionality be delegated to the dhcpcd.conf file just like MTU.

Richard Cranium 05-31-2010 03:32 PM

Quote:

Originally Posted by SiegeX (Post 3987738)
Thanks. I put back the original rc.inet1 and commented out #option interface_mtu in /etc/dhcpcd.conf as you suggested. But I wonder if it would still be prudent to add a $DHCP_KEEPMTU variable that one can set from rc.inet1.conf? If not, then I would propose that $DHCP_KEEPRESOLV be removed and instead this functionality be delegated to the dhcpcd.conf file just like MTU.

The dhcpcd.conf file settings are fine unless you have multiple interfaces to different networks. I'd prefer the variable in the rec.inet1.conf file, myself.


All times are GMT -5. The time now is 12:03 AM.