LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Network route add file (https://www.linuxquestions.org/questions/linux-networking-3/network-route-add-file-327237/)

David@330 05-26-2005 05:26 AM

Network route add file
 
Hi All

Can someone tell me where the file is, when you add route parameters on Linux Redhat 9.x...?

Thanks

niknah 05-26-2005 06:01 AM

I'm not sure about redhat 9,
but in previous redhat's it's been in
/etc/sysconfig/static-routes

and later versions in...
/etc/sysconfig/network-scripts/eth0-route

if you're using dhcp, you may need to add...
/etc/dhclient-exit-hooks

David@330 05-26-2005 06:57 AM

Hi niknah

Had a look in those directory's, no luck...!
{/etc/sysconfig/static-routes} the file static-routes is their but empty, replaced it with one that has info. Did not work, even renamed the file to see if the system needed the file. It did even complain about the file...! So thats not the file.

and later versions in...
{/etc/sysconfig/network-scripts/eth0-route}had a look in that directory for that file no such file name.!

But when you enter route add -net 111.111.111.0 netmask 200.222.222.0 gw 111.111.222.5
it add it, but which file does it go and update.?

Thanks

fr_laz 05-26-2005 07:15 AM

Hi,

1/ the mask you propose won't be accepted by route... it's invalid
2/ the file used for current routing table is /proc/net/route, but it's a cache, not a conf file. Thus the route won't be kept after restarting the network service.
3/ maybe you use network profiles, in which case the conf file would be /etc/sysconfig/networking/profiles/.../route-eth0

David@330 05-26-2005 07:38 AM

Hi fr_laz

That {route add -net 111.111.111.0 netmask 200.222.222.0 gw 111.111.222.5} is a example
and the command does work, because if I reboot the system it is still configured with all the info that I had type in.!
If I type netstat -r it list all the route parameters that i have added...!


All times are GMT -5. The time now is 08:54 PM.