Setting static routes in Linux?

Discussion in 'OT Technology' started by Joe_Cool, Oct 14, 2003.

  1. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,443
    Likes Received:
    603
    This is something I did a while back, because the ISP's dhcp wasn't giving me a default route. Now that my IP has changed, it's breaking everything. So I need to either just undo the old one, or else set a new one, but I can't remember where to do it!!!

    So who knows where the static routes are set, particularly under RedHat 9? Any help is much appreciated.
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    use the "route" command? :dunno:
     
  3. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,443
    Likes Received:
    603
    Sorry, I was unclear. I mean to automate setting a static route. I currently need to do a route del... then a route add... to make it work.

    I want to avoid that.
     
  4. Rob

    Rob OT Supporter

    Joined:
    Jul 6, 2002
    Messages:
    88,626
    Likes Received:
    41
    Location:
    Atlanta, GA
    You could probably make a shell script that checks /var/lib/dhcp/* to see when the IP changes. Then have it recalcuate the route based on the new IP. You could then set cron to run this script every 10 minutes or so.

    Or you could just call the ISP and tell them that obviously something is wrong. But what it REALLY sounds like is happening to me is that the DHCP server is getting a default route, but somehow you setup the linux machine to ignore this route and use a static route.

    So take the advice I gave you and do those steps in reverse order. :cool:
     
  5. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,443
    Likes Received:
    603
    Ok, let me rephrase the question. I've got an incorrect static route popping up on my linux (RH9) computer. I've forgotten where to set this. Can anyone help out?
     
  6. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    If you need to change your static routes use the Network conifguration tool.
     
  7. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,457
    Likes Received:
    12
    Did you check your rc3.d area to see if you have any soft links to scripts that add static routes? This is a common method of adding static routes.

    -crontab -l
     

Share This Page