Monday, July 4, 2011

How to find out Gateway/Router IP address under Linux/Unix

Run route command
route -n

Output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.42.0       0.0.0.0         255.255.254.0   U     1      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         10.0.43.254     0.0.0.0         UG    0      0        0 eth0

10.0.43.254 is gateway IP address for the computer. The flag U indicates that route is up and G indicates gateway.

You can also run netstat command to find the gateway.
netstat -nr

Output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.42.0       0.0.0.0         255.255.254.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.0.43.254     0.0.0.0         UG        0 0          0 eth0



4 comments:

  1. This costs nothing but time and can be a great way to introduce new customers to your
    company and encourage loyalty within your current clientele.

    The worksheet also includes other financial entries such as:
    . Even perhaps one of the buyers or users hasn't paid, and money that you were assuming isn't
    forthcoming and you now want to start working out creditor costs.


    My web page best hotel offers

    ReplyDelete
  2. Hi! I could have sworn I've been to this blog before but after going through a
    few of the posts I realized it's new to me. Regardless,
    I'm definitely delighted I found it and I'll be bookmarking it and checking back regularly!


    my page Buy Breast Actives (Www.Myprgenie.Com)

    ReplyDelete
  3. magnificent put up, very informative. I'm wondering why the opposite experts of this sector do not notice this.

    You should proceed your writing. I am sure, you have a great readers'
    base already!

    Feel free to surf to my site :: unsecured loan

    ReplyDelete

There was an error in this gadget