LinuxQuestions.org
Visit Jeremy's Blog.
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 01-29-2009, 04:30 AM   #1
serge
Member
 
Registered: Apr 2007
Posts: 45

Rep: Reputation: 15
/etc/sysconfig/route-interface default gateway


I'm running CentOS 5.2 on a box and want to configure a couple of static routes (still available after 'service network restart' and a reboot).
I read at 14.4. Configuring Static Routes that this can be configured in /etc/sysconfig/network-scripts/route-interface (e.g. eth0). It also says I need to specify the default gateway in this file, but this is already defined in /etc/sysconfig/network would/does setting both cause conflicts of some sort?

Last edited by serge; 01-29-2009 at 04:31 AM.
 
Old 01-29-2009, 09:11 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by serge
It also says I need to specify the default gateway in this file, but this is already defined in /etc/sysconfig/network would/does setting both cause conflicts of some sort?
AFAIK, RHEL's network scripts are smart enough to ignore duplicated / identical GATEWAY entries. If you don't want your default router to get clobbered, set up the static routes using the notation:

Code:
ADDRESS0=X.X.X.X
NETMASK0=X.X.X.X
GATEWAY0=X.X.X.X
Code:
ADDRESS1=X.X.X.X
NETMASK1=X.X.X.X
GATEWAY1=X.X.X.X
... etc.

Important note: if you do not have physical access to this server (i.e. it's hosted somewhere far away), be sure to test your configuration elsewhere before trying to implement the change. Messing with routing tables can be a quick way to get "locked out" of your server.
 
Old 01-29-2009, 10:05 PM   #3
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi serge,

Quote:
Originally Posted by serge View Post
I'm running CentOS 5.2 on a box and want to configure a couple of static routes (still available after 'service network restart' and a reboot).
unless your centos box is a router (that is including if you have both multiple NICs and any VPN set up) - you dont need to push route on your NIC because by default it will most likely has only 1 way to the internet (any network) 0.0.0.0/0 which is your default router via that same interface.

HTH.
 
  


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
Starting an Interface without a Default Subnet Route LinuxGeek Linux - Networking 5 08-30-2006 06:46 AM
DHCP default route attached to loopback interface chiefdan Linux - Hardware 2 12-06-2005 05:08 PM
How to add default gateway in /etc/sysconfig/network-scripts/* zamri Linux - Networking 2 09-06-2005 10:32 AM
dhclient not setting default gateway - no WAN route kadissie Linux - Networking 2 03-10-2005 04:55 AM
default route without a gateway scylla Linux - Networking 1 10-21-2004 01:40 AM


All times are GMT -5. The time now is 07:10 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration