LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   find out gateway address (https://www.linuxquestions.org/questions/linux-networking-3/find-out-gateway-address-939989/)

daedlock 04-16-2012 02:19 AM

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?

acid_kewpie 04-16-2012 02:25 AM

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.


All times are GMT -5. The time now is 11:44 PM.