The Silicon Underground
  Welcome to Dave Farquhar's Silicon Underground Monday, November 23 2009 @ 11:17 AM CST  
Theme Changer
Change the look of the site by selecting a theme below:

What's New
STORIES
No new stories

COMMENTS last 48 hrs
  • Why don't wins co...

  • LINKS last 2 wks
    No recent new links

    Google Ads

    User Functions
    Username:

    Password:

    Don't have an account yet? Sign up as a New User

    Firefox


    Setting the MTU automatically in Debian   
    Tuesday, August 03 2004 @ 11:14 PM CDT
    By David L. Farquhar

    I run this website off a server running on an ADSL line in a spare bedroom of my home. My server of choice is Debian, because it's Linux which makes it fast, reliable, and cheap, and Debian makes it pretty easy to install only what you want and need, so I can have a server OS that's only using 125 megabytes of disk space, leaving most of my drive available for something useful, like, oh, content.

    Now, the downside of modern DSL: Southwestern Bell, like most ISPs these days, uses PPPoE. So not only can your IP address change with no notice whatsoever, you also have the hassles of PPPoE. With the default settings, some unknown but noticeably large percentage of web users won't be able to access a web server running on a DSL connection using PPPoE.

    The reason is MTU and fragmentation.

    Yes, you remember MTU if you used Windows 9x back in the bad old days of dialup. Tweakers would play around with the MTU settings in hopes of squeezing just a little more performance out of their 56K modems, and they would swear that one utility did a better job than any others, or that this MTU setting was optimal and the conventional wisdom of 576 stank... Remember those flamewars?

    Well, with broadband, theoretically the right setting to use is 1500. Trouble is, PPPoE steals some of that packet space, and the result is something worse than slow speeds. In some scenarios, you completely vanish.

    The way to make my website reappear is to issue the command ifconfig eth0 mtu 1472. The exact number doesn't seem to matter much. It appears for me that 1472 is the maximum I can use. (It can vary from ISP to ISP, in case you're wondering.)

    Excellent. Problem solved.

    Not so fast. Problem solved until my server reboots. Linux doesn't need to reboot, right? Right you are. But here in St. Louis, the power likes to hiccup a lot, especially in the summertime. My server is on a UPS, but every once in a while, in the middle of the night, there must be a long enough power failure that my UPS dies, because every once in a while I fall off the 'net again.

    To set the default MTU permanently--that is, to change it automatically on bootup--one normally would change the ifup script or the rc.startup script. Except Debian doesn't have either of those.

    My kludgy solution: cron. Log in as root, issue the command crontab -e, and add the following line:

    */2 * * * * ifconfig eth0 mtu 1472

    With this in place, only seconds will elapse between the time my power comes back on for good and I reappear on the 'net. I can live with that.

      [ Views: 3870 ]  


    Setting the MTU automatically in Debian | 5 comments | Create New Account
    The following comments are owned by whomever posted them. This site is not responsible for what they say.
    Setting the MTU automatically in Debian
    Authored by: smahaffey on Wednesday, August 04 2004 @ 12:27 AM CDT
    Interesting. I have a little Debian box that I'm using as an auxiliary workstation at my office. No, I didn't master the arcane art of Debian installs, the new beta installer is pretty usable.

    I never knew that Debian didn't have an rc.local or equivalent. Also curious, "who -r" reports runlevel 2, tho I boot to a gui login. The rc2.d - rc5.d directories seem the same. I also see an /etc/rcS.d directory, complete with a README file. The README says that the scripts are executed once, even in single user mode. Another curiosity, since it also states that "* After the S40 scripts have executed, all local file systems are mounted and networking is available". I don't know why networking would start in single user mode.

    Besides being Sarge based, I also installed the 2.6 kernel, so I don't know if this will be the same for your presumably more conservative server. If so, though, it would appear that making a short init script and linking it with a link in /etc/rcS.d and a link name starting with S5 should do the trick.


    ---
    -Steve

    [ Reply to This ]

    Setting the MTU automatically in Debian
    Authored by: S. Hypocrite on Wednesday, August 04 2004 @ 09:21 AM CDT
    I've never used it, but I see that inittab has an action field called "powerokwait" that should execute when the UPS notifies init that the power is back on. I don't know what the hardware requirements would be. My UPS came with a cable and some windows-only software, but I never tried to use it. I don't run a server, and just want the UPS to filter the line power and give me time to shut down. Anyway, "cron" might be more robust.

    I'm running a hard-drive install of Knoppix with the 2.6 kernel. Having come recently from Mandrake, I'm no expert on the Debian boot scripts. I have a (empty) directory "/etc/rc.boot" which I supposed was for local stuff.

    For "who -r" I get "run-level 5", which matches the default runlevel in inittab.



    ---
    Yeah, but it's a moist heat.

    [ Reply to This ]

    What's Related
  • More by DaveF
  • More from Linux

  • Story Options
  • Mail Story to a Friend
  • Printable Story Format


  • Calendar
    November 2009
    SuMoTuWeThFrSa
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    1
    2
    3
    4
    5
    Click on any day to see postings and events for that date.

    Referrals

    Top 10 by Comments
    Story TitleComments
    Cheap laptops from Sotec 253
    An untrustworthy vendor 164
    Upgrading an eMachine 125
    eMachine upgrade advice 99
    Why I dislike Microsoft 51
    Upgrade diary: Gateway G6-400 35
    And we're live 30
    The day after the Columbia 22
    How to pray 22
    CD-ROM troubleshooting under Windows 9x 20

    Top 10 Read
    Story TitleViews
    eMachine upgrade advice 74333
    Upgrading an eMachine 63083
    How to view a blg file in Windows 2000 50612
    Cheap laptops from Sotec 32796
    Upgrade diary: Compaq Presario 7360 19997
    Upgrade diary: Gateway G6-400 19874
    CD-ROM troubleshooting under Windows 9x 15549
    Finding an open-source alternative to Ghost 14292
    Big trouble 13815
    Salary cap? Baseball needs something 11798

    Topics
    Home
    Apache (2)
    Baseball (63)
    Book reviews (2)
    Business (1)
    Christianity (57)
    Cooking (1)
    Copyright (16)
    Curmudgeonry (1)
    Design (7)
    DOS (6)
    Games (4)
    Genealogy (11)
    General (507)
    Hardware (168)
    Health (13)
    Human Interest (9)
    Humor/Satire (19)
    Investing (4)
    Journalism (1)
    Linux (93)
    Macintosh (22)
    Model Building (3)
    Music (33)
    net.culture (40)
    Personal (88)
    Photography (6)
    Politics (3)
    Retro Computing (26)
    Saving money (72)
    Servers and Networking (18)
    Society (49)
    Software (55)
    Spam (13)
    St. Louis (23)
    This weblog (14)
    Toy trains (74)
    Troubleshooting (7)
    Useless Trivia (1)
    Vendors (6)
    Video (21)
    Viruses (12)
    Windows (120)
    Writing (16)

    Older Stories
    Wednesday 30-Sep
  • 401(K) Paperwork (0)

  • Sunday 27-Sep
  • First impressions: HP Mini 110 (1)

  • Saturday 26-Sep
  • Getting more screen real estate in Firefox (0)

  • Wednesday 23-Sep
  • Barfy. (4)

  • Monday 21-Sep
  • Why I quit my job (2)

  • Saturday 12-Sep
  • Slimming down Windows XP for SSDs and nettops (0)

  • Thursday 10-Sep
  • And... bailing out. (3)

  • Friday 04-Sep
  • End of the innocence (0)

  • Monday 31-Aug
  • Installing Windows off USB (1)

  • Friday 21-Aug
  • Diving into real estate (0)

  • Who's Online
    Guest Users: 7

    Syndicate!
    Get your RSS/RDF fix here.

    List of all stories
    Click here for a list of all the entries on this site


    Created this page in 0.94 seconds


     Copyright © 2009 Dave Farquhar's Silicon Underground
     All trademarks and copyrights on this page are owned by their respective owners.

    Powered by GL 1.3.x