Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-03-2010, 04:34 PM   #1
Registered: Feb 2010
Posts: 107

Rep: Reputation: 15
static routes

Hello, i have an ubuntu server which im configuring as router.

In one interface i have internet, and in the other one i have LAN, and it works ok, i can surf the net, set up a server etc etc

Now i have a curiosity, my lan is in eth0

Can i add a pc in that lan with ip: (note different subnet) and add a route policy like: route add gw through eth0 ???

If thats not possible, what are static routes for? any practical example??
Old 08-03-2010, 07:03 PM   #2
LQ Newbie
Registered: Jan 2004
Location: Sydney, Australia
Distribution: RHEL
Posts: 22

Rep: Reputation: 17
route add eth0
sets up a host route. There is no need for a gateway as localhost is the router.

route add -net netmask eth0
does the subnet.

The simpler way is to assign to eth0 as a second address and let the route be implied.

Last edited by lartman; 08-03-2010 at 07:05 PM. Reason: typo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static routes using routes/ifroutes-eth-id.. files and default gateway disabled TimtheEagle Linux - Networking 0 05-31-2008 07:08 PM
static routes and ifconfig yiux Linux - Networking 4 06-11-2007 06:24 PM
How do I config static routes? mikezang Linux - Networking 4 10-31-2005 10:29 AM
Max Static Routes? roundst Linux - Networking 2 07-28-2005 02:51 AM
static-routes in Mandrake 10.0 tallthom Mandriva 1 09-27-2004 12:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration