Find the answer to your Linux question:
Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By Lazydog
Hi , I setup routing table. Code: [root@]# ip route show table 2 xx.xx.xx.xx/28 dev eth2 scope link src xx.ip.xx.ip default via xx.gw.xx.gw dev eth2 [root@]# ip route show table ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    44

    Routing table gone after ifdown


    Hi ,

    I setup routing table.

    Code:
    [root@]# ip route show table 2
    xx.xx.xx.xx/28 dev eth2  scope link  src xx.ip.xx.ip
    default via xx.gw.xx.gw dev eth2
    [root@]# ip route show table 1
    yy.yy.yy.yy/28 dev eth1  scope link  src yy.ip.yy.ip
    default via yy.gw.yy.gw dev eth1
    however, when I issue command ifdown eth2, the routing table 2 is gone.

    Code:
    [root@]# ip route show table 2
    [root@]# ip route show table 2
    [root@]# ip route show table 2
    but table 1 still exist

    I added ip route as follows.
    Code:
    ip route add xx.xx.xx.xx/28 dev eth1 src xx.ip.xx.ip table IGA
    ip route add default via xx.gw.xx.gw table IGA
    ip route add yy.yy.yy.yy/28 dev eth2 src yy.ip.yy.ip table BTL
    ip route add default via xx.gw.xx.gw table BTL
    I also add the ip route on /etc/rc.local so it will load when system restart.


    Is there a way to fix this issue? even I issue ifdown eth2, the routing table will not get lost.

    Please advice


    Thanks!

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Posting the same question over and over again is not going to get you an answer any faster. You should keep posting to the same thread that way all the question about this topic are together so the next person searching will find all the answers in one location instead of having to read 5+ posts.

    Now to answer your question. Table 2 to is tied to eth2. When you power down eth2 the route is no longer available thus it is removed from the routing table.
    srj likes this.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    3
    /etc/rc.local is just a bad place to employ routing information these days.

    Didn't I tell you, in response to a different post of yours, the following?

    "Use rule-ethX and route-ethX files in /etc/sysconfig/network-scripts/
    blog.mc-thias.org/?title=routing-with-linux-when-using&more=1&c=1&tb=1&pb=1"

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jun 2012
    Posts
    2
    It looks like what you've done is temporary static routing. I think what you're looking to do is persistent/permanent static routing.

    gstewart hit the nail on the head, but for clarity, below is a url with examples of setting up both temporary and persistent static routing. Sadly, I had to break the url with a space due to my post count.

    www linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking#Adding_Tempo rary_Static_Routes

    Hope that helps further.

  6. #5
    Just Joined!
    Join Date
    Jan 2011
    Posts
    44
    Thanks Everyone for all your post and help. REally appreciated it very much. and Sorry for any inconvenience caused and double post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •