LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-03-2010, 05:34 PM   #1
fdelval
Member
 
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 192.168.1.0 in eth0

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

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

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

route add -net 192.168.111.0 netmask 255.255.255.0 eth0
does the subnet.

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

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


Reply


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 08:08 PM
static routes and ifconfig yiux Linux - Networking 4 06-11-2007 07:24 PM
How do I config static routes? mikezang Linux - Networking 4 10-31-2005 11:29 AM
Max Static Routes? roundst Linux - Networking 2 07-28-2005 03:51 AM
static-routes in Mandrake 10.0 tallthom Mandriva 1 09-27-2004 01:51 AM


All times are GMT -5. The time now is 05:13 AM.

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