LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 06: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, 06:18 AM   #2
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Rep: Reputation: 2
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, 06: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, 05:32 AM   #4
mgai7755
Member
 
Registered: Apr 2011
Posts: 41

Rep: Reputation: 2
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, 07:42 AM   #5
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 195

Rep: Reputation: 50
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, 08: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, 08: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


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


All times are GMT -5. The time now is 04:02 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration