LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How do I config static routes? (https://www.linuxquestions.org/questions/linux-networking-3/how-do-i-config-static-routes-378617/)

mikezang 10-31-2005 10:18 AM

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?

nistelrooy 10-31-2005 10:58 AM

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

:)

mikezang 10-31-2005 11:08 AM

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?

nistelrooy 10-31-2005 11:16 AM

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.

mikezang 10-31-2005 11:29 AM

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?


All times are GMT -5. The time now is 12:35 AM.