Operating System - HP-UX
1822201 Members
3838 Online
109640 Solutions
New Discussion юеВ

Re: Regarding Default g/w

 
nandam
Frequent Advisor

Regarding Default g/w

Hi,

Could you please tell me how to identyfe defaust G/W by using netstat -nr
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: Regarding Default g/w

# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
130.1.1.15 130.1.1.15 UH 0 lan0 4136
192.151.52.241 130.1.0.248 UGH 0 lan0 0
216.52.17.135 130.1.0.248 UGH 0 lan0 0
66.142.254.157 130.1.0.248 UGH 0 lan0 0
130.1.0.0 130.1.1.15 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 130.1.1.51 UG 0 lan0 0

It's the one labeled default on the last line.


Pete

Pete
nandam
Frequent Advisor

Re: Regarding Default g/w

Thanks

i got thank you very much.
Patrick Wallek
Honored Contributor

Re: Regarding Default g/w

Your default gateway will be the one with the word "default" in the first column of the output.

Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
170.7.54.141 170.x.xx.141 UH 0 lan0 4136
170.7.54.0 170.x.xx.141 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 170.x.xx.221 UG 0 lan0 0

In this case, my default gateway is the last line of the output.