How to save routing table entries?
I have looked at the networking how-to, the man pages, everything, but I can't seem to find the answer to this question.
How do I save changes to the routing table in redhat 9? For example: route add -net 10.5.0.0 netmask 255.255.0.0 gw 89.80.89.100 I add this to the table, magic happens, all is good. Then I reboot, and it goes away. I can't find documentation anywhere on how to make it stay. Could somebody clue me in? The way most people talk, it should just be saved automatically. Is my installation messing up? |
Did you configure your gateway in /etc/sysconfig/network? This file contains your default gw information persistently. The way that you entered it is nonpersistently, which means it will go bye, bye on reboot.
|
Thanks for your help. However, nobody ever seems to just answer the question when I post this one. I think because it is a difficult question. If you must know, the gateway to that network isn't my default gateway. It is a little network in the back. The default gateway is to another net.
And I know, I could add a route to the main gateway to redirect to this other gateway, but I just want to do it at the Linux box, since it is the only machine connecting to this other network. So, Is there a way to add this route persistently so it will stick around? Is it a switch for route (like -p on Wondoze), or must I modify a file somewhere? |
The only other place that routes are stored on are in /etc/sysconfig/static-routes.
|
As I mentioned earlier, any changes made by the 'route add' command are lost on system reboot.
|
Some Linux versions don't have anything under /etc/sysconfig/static-routes, so you'll have to create the file using emacs or vi... Hope this helps.
|
Thanks much for your help. I looked through the
/etc/rc.d/init.d/network script that is run on startup, and saw that it looked for that file. At first I was confused about the syntax. What it looks like is that the config file just does a 'route add -' and then appends any lines in the '/etc/sysconfig/static-routes' file that start with "any" Example: A line like this in static-routes: any host 10.5.1.5 gw 89.80.89.100 runs command: route add -host 10.5.1.5 gw 89.80.89.100 It seems to work. Any better ideas? |
how to save routing table in oracle linux server 7
How do I save changes to the routing table in oracle linux
For example: route add -net 10.5.0.0 netmask 255.255.0.0 gw 89.80.89.100 eno1 I add this to the table, magic happens, all is good. Then I reboot, and it goes away. after every rebooting i need to add routing table how i save this table permanent |
All times are GMT -5. The time now is 06:11 PM. |