LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2005, 10:18 AM   #1
mikezang
LQ Newbie
 
Registered: Oct 2005
Location: Tokyo, Japan
Posts: 6

Rep: Reputation: 0
How do I config static routes?


I config my static route using route add command, but I want to let it work when boot, I want to know if the config file is /etc/sysconfig/static-routes in FC4, as I couldn't find that file, does this mean have create this file?
 
Old 10-31-2005, 10:58 AM   #2
nistelrooy
Member
 
Registered: Oct 2003
Location: Singapore
Distribution: debian
Posts: 162

Rep: Reputation: 30
Re: How do I config static routes?

Hi

Take a look at the /etc/sysconfig/network-scripts/route-* files.

To get these files to work, simply create a file named route-<dev> in the /etc/sysconfig/network-scripts/ directory. Replace <dev> with your device name (eth0 for example)

This file should contain one line like the following :

0.0.0.0/0 via 192.168.2.1

 
Old 10-31-2005, 11:08 AM   #3
mikezang
LQ Newbie
 
Registered: Oct 2005
Location: Tokyo, Japan
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks a lot.
I config it with GNOME network tool, then I open that file like you said, but I found the contents is different from what you said as below:
GATEWAY0=192.168.1.1
NETMASK0=255.255.255.0
ADDRESS0=192.168.1.0

Can you tell me why?
 
Old 10-31-2005, 11:16 AM   #4
nistelrooy
Member
 
Registered: Oct 2003
Location: Singapore
Distribution: debian
Posts: 162

Rep: Reputation: 30
The difference is, you've configured statically assigned IP/gateway/netmask, in which all connections other than your ip address will be static-ly routed to your gateway for routing to process. (in other words, static routes are created automatically!)

Other than that, if you want to create your own home routing (that happens when you have many subnets). You may have to try the method above.
 
Old 10-31-2005, 11:29 AM   #5
mikezang
LQ Newbie
 
Registered: Oct 2005
Location: Tokyo, Japan
Posts: 6

Original Poster
Rep: Reputation: 0
Well, I will show you the detail for my home LAN, you can find it here
Code:
http://www.geocities.jp/mikezang/pics/LanInZangLand.jpg
Now I can ping from 192.168.1.10 to 192.168.3.100 with route above, but I can't ping from 192.168.3.100 to 192.168.1.10, can you tell me what I should add to route table on my pc or modem or route?
 
  


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
Max Static Routes? roundst Linux - Networking 2 07-28-2005 03:51 AM
automatic static routes? eantoranz Linux - Networking 5 07-19-2005 09:30 PM
Setting static routes on LAN cranium2004 Linux - Networking 3 01-07-2005 12:57 AM
static-routes in Mandrake 10.0 tallthom Mandriva 1 09-27-2004 01:51 AM
Adding static routes to fc1 router Tom123 Linux - Networking 1 08-20-2004 04:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:57 PM.

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
Open Source Consulting | Domain Registration