+ Reply to Thread
Results 1 to 2 of 2

Thread: HOWTO: Adding static routes in Ubuntu.

  1. #1
    Administrator TitanKing's Avatar
    Join Date
    2005 Feb
    Location
    Cape Town
    Posts
    6,543

    Default HOWTO: Adding static routes in Ubuntu.

    There are many ways to do this, however I will show the one I use most often.

    When adding a route in Ubuntu/Linux you would normally just run this for instance:

    Code:
    $ route add -net 10.0.0.0 gw 10.2.5.1 netmask 255.0.0.0 dev eth0
    However, when rebooting this route will not be active, this is way you need to add static routes.

    Create a file called "static-route" in /etc/network/if-up.d

    Now make the file look like this and change the example routing as you would require it:

    Code:
    #!/bin/sh
    # Set static routes
    #
    
    # Below are examples of how it should look to add static routes.
    /sbin/route del -net default gw 10.2.5.1 netmask 0.0.0.0 dev eth0
    /sbin/route add -net 10.0.0.0 gw 10.2.5.1 netmask 255.0.0.0 dev eth0
    Well there you go, you could now create multiple static routes in one simple file.
    "The fact of the matter is, Open Source is better."
    "Linux users are not pirates, we're ninjas."

    Vote for Groundbreaker II



    Follow me on Twitter.

  2. #2

    Default Re: HOWTO: Adding static routes in Ubuntu.

    *takes notes*


    ::
    Intel Core2Quad Q9550 @ 10% OC [CPU] ::Asus P5Q [MoBo] ::8GB Transcend DDR2-800 [RAM] @ 10% OC ::
    :: eVGA
    9800GX2 1GB [GFX]
    //GeCube 3870X2 O.C. Edition [GFX] ::4TB Storage [HDD] ::Samsung 22", DELL 19", HYC 19" ::
    :: Microsoft
    Natural Ergonomic 4000 [Keyboard] :: Logitech MX518 Laser [Mouse] :: Creative T660 5.1 [SFX] ::

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

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