LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2011, 05:13 AM   #1
linux_user2011
LQ Newbie
 
Registered: Apr 2011
Posts: 14

Rep: Reputation: 0
Where does rhel linux store its default router ip


Hi,
Where does rhel linux store its default router ip (as solaris stores in /etc/defaul)? Basically I want to know if a default router is configured or not. Is it enough if I just run route command and check for the gateway IP for default destination... Please help...
 
Old 04-20-2011, 05:18 AM   #2
mgai7755
Member
 
Registered: Apr 2011
Posts: 51

Rep: Reputation: 10
I guess that you're looking the network configuration file... On red hat you'll find it there : /etc/sysconfig/network
 
Old 04-21-2011, 05:04 AM   #3
linux_user2011
LQ Newbie
 
Registered: Apr 2011
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for your reply mgai7755.

I just checked out the contents of /etc/sysconfig/network using 'cat /etc/sysconfig/network' and got the below output:
NETWORKING=yes
HOSTNAME=vm-rlnx-rds1203.bmc.com

I dont see any entry here for the default router. But when I run the 'route' command i get the below output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.128.28.0 * 255.255.252.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 10.128.31.253 0.0.0.0 UG 0 0 0 eth0

Here the Ip for default router is shown as 10.128.31.253

I could not decide whether default router is configured or not as '/etc/sysconfig/network' does not have entry for it but 'route' command's output shows a default router. Please help.
 
Old 04-22-2011, 04:32 AM   #4
mgai7755
Member
 
Registered: Apr 2011
Posts: 51

Rep: Reputation: 10
If I'm not wrong, if the GATEWAY entry isn't filled it, you probably do not have a manually specified default gateway.

However, this file also contains information related to a particular NIC : /etc/sysconfig/network-scripts/ifcfg-eth0 (or ethX if you've got more than one NIC)

Source : CentOS/REHL documentation

Does it answer your question ?
 
Old 04-22-2011, 06:42 AM   #5
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 215

Rep: Reputation: 66
Since the default gateway listed in your routing table output says eth0 I would suggest you look here:

cat /etc/sysconfig/network-scripts/ifcfg-eth0
 
Old 04-22-2011, 07:10 AM   #6
vickyk
Member
 
Registered: Dec 2009
Posts: 38

Rep: Reputation: 6
You can also check the following file:
/etc/sysconfig/network-scripts/static-route

Also, I think if the file:
/etc/sysconfig/network-scripts/ifcfg-eth0

has the entry BOOTPROTO=DHCP, then the router (gateway) IP will not be shown as it is taken automatically.

Correct me if I am wrong.
 
Old 04-25-2011, 07:31 AM   #7
linux_user2011
LQ Newbie
 
Registered: Apr 2011
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for all the replies. They were useful...
 
  


Reply



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
Could I use Squid v2.5 in RHEL 5, by default its use v2.6 addil Linux - Newbie 2 04-12-2009 01:17 PM
Router => use soft(Slack) or from store? WannaLearnLinux Linux - Networking 6 03-10-2004 07:28 PM
Linux router - setting up a DMZ or default machine to route to Rooboy Linux - Networking 12 02-18-2004 03:44 PM
Where does Grip store tunes by default? Scruff Linux - Software 13 08-31-2003 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration