ABBAS KHAN
2008-Aug-19 13:38 UTC
[CentOS] Is there a way to save the routing table permanently?
I'm adding the default gateway to the route through "route add default gw 10.10.10.10" which is also shown in "route -n" but the problem is that as soon as I restart the network through /etc/init.d/network restart; the route sets to default one...! SO, my question is there any way to save the modified route permanently by hardcoding the changes? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080819/642570c3/attachment-0005.html>
Tom Diehl
2008-Aug-19 13:48 UTC
[CentOS] Re: Is there a way to save the routing table permanently?
On Tue, 19 Aug 2008, ABBAS KHAN wrote:> I'm adding the default gateway to the route through "route add default gw > 10.10.10.10" which is also shown in "route -n" but the problem is that as > soon as I restart the network through /etc/init.d/network restart; the route > sets to default one...! > SO, my question is there any way to save the modified route permanently by > hardcoding the changes?There are several ways, actually. System-config-network is one way, or if like me you prefer to edit the config files by hand you can edit the files in /etc/sysconfig/network-scripts/ifcfg-eth* or the file /etc/sysconfig/network. There needs to be a GATEWAY= line in one of those files. If you have an existing GATEWAY line modify it to taste. If you have no default gateway I would suggest putting it in /etc/sysconfig/ifcfg-eth?. Where the ? corresponds to the interface that points to the gateway. Hope this helps. Regards, -- Tom Diehl tdiehl at rogueind.com Spamtrap address mtd123 at rogueind.com
Stephen Moccio
2008-Aug-22 12:58 UTC
[CentOS] Is there a way to save the routing table permanently?
You can place the statement in /etc/sysconfg/static-routes. This file will be used when the network starts up. _____ From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf Of ABBAS KHAN Sent: Tuesday, August 19, 2008 9:38 AM To: CentOS mailing list Subject: [CentOS] Is there a way to save the routing table permanently? I'm adding the default gateway to the route through "route add default gw 10.10.10.10" which is also shown in "route -n" but the problem is that as soon as I restart the network through /etc/init.d/network restart; the route sets to default one...! SO, my question is there any way to save the modified route permanently by hardcoding the changes? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080822/8f08ee37/attachment-0005.html>
Florin Andrei
2008-Aug-22 17:14 UTC
[CentOS] Is there a way to save the routing table permanently?
ABBAS KHAN wrote:> I'm adding the default gateway to the route through "route add default > gw 10.10.10.10 <http://10.10.10.10>" which is also shown in "route -n" > but the problem is that as soon as I restart the network through > /etc/init.d/network restart; the route sets to default one...! > SO, my question is there any way to save the modified route permanently > by hardcoding the changes?It would be very nice if the init.d script would allow the sysadmin to do something like "service network saveroutes". I always thought that would be a neat feature. It should probably go into Red Hat's bugzilla before it gets implemented. -- Florin Andrei http://florin.myip.org/