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 04-16-2012, 02:19 AM   #1
daedlock
LQ Newbie
 
Registered: Jul 2011
Posts: 5

Rep: Reputation: Disabled
find out gateway address


Hello,

I am trying to find a command or file that is valid for all suse versions to get the gateway address.
I call "route -n" and i expect to get the line
Destination Gateway Genmask Flags
0.0.0.0 "gatewayip" 0.0.0.0 UG 0 0 0 eth0
but it doesn't come. All gateway address is 0.0.0.0 and flag is not UG. Is it mean that it has no gateway address? I also try "network -rm" and variaons of that but same output again.
When i look at /etc/sysconfig/network/routes file i can see the gateway addres but i can not use this file because it doesn't exist for all versions. Can you help me?
 
Old 04-16-2012, 02:25 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
that "route -n" line is for the gateway, yes, so if it's not there, there isn't one. That command should be all you need.
 
  


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
Howto find gateway address through code /usr/src Linux - Networking 9 03-18-2013 12:39 PM
how do i find my gateway address on eth0? seth Linux - Networking 10 03-21-2010 03:42 AM
Router gateway address being picked up as primary DNS address under SuSe Hubmasterflex Linux - Networking 13 10-18-2008 01:40 PM
Find real ip address using link local address, mdns/zeroconf dannemanare Linux - Networking 0 01-17-2008 04:31 AM
What is Gateway address and what is Network address? abefroman Linux - Networking 1 03-17-2004 08:25 PM


All times are GMT -5. The time now is 12:45 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