Discussion:
How to see the routing table and dns in adb shell
Joe Petruchi
2009-05-26 06:09:33 UTC
Permalink
Hi All

Does anybody knows how we can see the routing table and dns servers in adb
shell.

Any help in this regard will be great ..

Thanks
Joe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
Brian Liu
2009-05-26 07:13:56 UTC
Permalink
For route table:
$ cat /proc/net/route

For DNS:
$ getprop net.dns1
Post by Joe Petruchi
Hi All
Does anybody knows how we can see the routing table and dns servers in adb
shell.
Any help in this regard will be great ..
Thanks
Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
MIYOKAWA, Nobuyoshi
2009-05-26 14:47:12 UTC
Permalink
Hi Joe,

For checking DNS server addresses, you can use getprop, such
as:

| # getprop net.dns1
| 192.168.32.18

or, if you'd like to know the values which dhcp server
offers:

| # getprop dhcp.tiwlan0.dns1
| 192.168.32.18

You also can see dhcp supply default gateway value:

| # getprop dhcp.tiwlan0.gateway
| 192.168.32.1

You might see all property values if you exec 'getprop'
without arguments.

If you'd like to see live routing table, the easiest(but
complicated to understand) way is to see /proc/net/route.

| # cat /proc/net/route
| Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
| tiwlan0 0020A8C0 00000000 0001 0 0 0 00FFFFFF 0 0 0
| tiwlan0 00000000 0120A8C0 0003 0 0 0 00000000 0 0 0

The Destination '00000000' means, of course, default route
and Gateway value '0120A8C0' means '1.32.168.192' in
decimal('192.168.32.1' in reverse), so you can know what is
default gateway address is.

Best Regards,
--
MIYOKAWA, Nobuyoshi


From: Joe Petruchi <petruchi.dream-***@public.gmane.org>
Subject: How to see the routing table and dns in adb shell
Date: Tue, 26 May 2009 11:39:33 +0530
Message-ID: <c707ba080905252309v115ffa52yad305cfc137c3f40-JsoAwUIsXosN+***@public.gmane.org>

| Hi All
|
| Does anybody knows how we can see the routing table and dns servers in adb
| shell.
|
| Any help in this regard will be great ..
|
| Thanks
| Joe
|
| |

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
Joe Petruchi
2009-05-30 12:30:04 UTC
Permalink
Thanks a lot

Regards
Joe
Post by MIYOKAWA, Nobuyoshi
Hi Joe,
For checking DNS server addresses, you can use getprop, such
| # getprop net.dns1
| 192.168.32.18
or, if you'd like to know the values which dhcp server
| # getprop dhcp.tiwlan0.dns1
| 192.168.32.18
| # getprop dhcp.tiwlan0.gateway
| 192.168.32.1
You might see all property values if you exec 'getprop'
without arguments.
If you'd like to see live routing table, the easiest(but
complicated to understand) way is to see /proc/net/route.
| # cat /proc/net/route
| Iface Destination Gateway Flags RefCnt Use Metric
Mask MTU Window IRTT
| tiwlan0 0020A8C0 00000000 0001 0 0 0
00FFFFFF 0 0 0
| tiwlan0 00000000 0120A8C0 0003 0 0 0
00000000 0 0 0
The Destination '00000000' means, of course, default route
and Gateway value '0120A8C0' means '1.32.168.192' in
decimal('192.168.32.1' in reverse), so you can know what is
default gateway address is.
Best Regards,
--
MIYOKAWA, Nobuyoshi
Subject: How to see the routing table and dns in adb shell
Date: Tue, 26 May 2009 11:39:33 +0530
| Hi All
|
| Does anybody knows how we can see the routing table and dns servers in adb
| shell.
|
| Any help in this regard will be great ..
|
| Thanks
| Joe
|
| |
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
Roman
2009-06-06 20:24:48 UTC
Permalink
Hi,

netstat -nr is another way to get the routing table.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.
Post by Joe Petruchi
Thanks a lot
Regards
Joe
Post by MIYOKAWA, Nobuyoshi
Hi Joe,
For checking DNS server addresses, you can use getprop, such
| # getprop net.dns1
| 192.168.32.18
or, if you'd like to know the values which dhcp server
| # getprop dhcp.tiwlan0.dns1
| 192.168.32.18
| # getprop dhcp.tiwlan0.gateway
| 192.168.32.1
You might see all property values if you exec 'getprop'
without arguments.
If you'd like to see live routing table, the easiest(but
complicated to understand) way is to see /proc/net/route.
| # cat /proc/net/route
| Iface Destination     Gateway         Flags   RefCnt  Use     Metric
 Mask            MTU     Window  IRTT
| tiwlan0       0020A8C0        00000000        0001    0       0       0
    00FFFFFF        0       0       0
| tiwlan0       00000000        0120A8C0        0003    0       0       0
    00000000        0       0       0
The Destination '00000000' means, of course, default route
and Gateway value '0120A8C0' means '1.32.168.192' in
decimal('192.168.32.1' in reverse), so you can know what is
default gateway address is.
Best Regards,
--
MIYOKAWA, Nobuyoshi
Subject: How to see the routing table and dns in adb shell
Date: Tue, 26 May 2009 11:39:33 +0530
| Hi All
|
| Does anybody knows how we can see the routing table and dns servers in adb
| shell.
|
| Any help in this regard will be great ..
|
| Thanks
| Joe
|
| |
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
simon
2009-06-07 10:04:45 UTC
Permalink
Post by Roman
Hi,
netstat -nr is another way to get the routing table.
Normally yes, except it doesn't work with the "netstat" command on
Android.
netstat -nr just does the same as netstat, namely it lists the open
TCP connections.

# netstat -nr
Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp 0 0 127.0.0.1:5037 0.0.0.0:*
LISTEN
tcp 0 1 192.168.10.178:55549 74.125.77.106:80
CLOSE_WAIT
tcp 0 0 192.168.10.178:44604 209.85.229.188:5228
ESTABLISHED
udp 0 0 0.0.0.0:43030 0.0.0.0:*
udp 0 0 0.0.0.0:9000 0.0.0.0:*
# netstat
Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp 0 0 127.0.0.1:5037 0.0.0.0:*
LISTEN
tcp 0 1 192.168.10.178:55549 74.125.77.106:80
CLOSE_WAIT
tcp 0 0 192.168.10.178:44604 209.85.229.188:5228
ESTABLISHED
udp 0 0 0.0.0.0:43030 0.0.0.0:*
udp 0 0 0.0.0.0:9000 0.0.0.0:*

(On an ADP1 using 1.5r2 firware from the HTC support page.)
--
Simon.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
simon
2009-06-07 10:09:16 UTC
Permalink
Post by simon
netstat -nr just does the same as netstat, namely it lists the open
TCP connections.
Sorry, correcting myself, it seems to list all open (IPv4?) sockets,
including UDP sockets and unconnected TCP sockets.
--
Simon.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
Andreas Kostyrka
2009-06-07 14:10:00 UTC
Permalink
Routes: cat /proc/net/route
Dns: cat /system/etc/resolv.conf
netstat -nr just does the same as netstat, namely it lists the open > TCP
connections.
Sorry, correcting myself, it seems to list all open (IPv4?) sockets,
including UDP sockets and unconnected TCP sockets.

-- Simon. --~--~---------~--~----~------------~-------~--~----~ You received
this message because yo...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform-/***@public.gmane.org
To unsubscribe from this group, send email to android-platform+unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en
-~----------~----~----~----~------~----~------~--~---
bcr000k
2013-10-22 06:02:06 UTC
Permalink
Hi,
is there any guarantee that /proc/net/route works across Android platforms
and phones? I mean, sometimes companies like Motorola decide to apply
extra security measures to prohibit developers from accessing useful
platform functionalities, like routing tables.
Does anybody have knowledge about this?

BC
Post by Andreas Kostyrka
Routes: cat /proc/net/route
Dns: cat /system/etc/resolv.conf
netstat -nr just does the same as netstat, namely it lists the open >
TCP connections.
Sorry, correcting myself, it seems to list all open (IPv4?) sockets,
including UDP sockets and unconnected TCP sockets.
-- Simon. --~--~---------~--~----~------------~-------~--~----~ You
received this message because yo...
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platform+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-platform-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/groups/opt_out.
biAji
2013-10-25 16:11:08 UTC
Permalink
Why not have busybox installed, then you can use busybox route to get the
ip route.
Post by bcr000k
Hi,
is there any guarantee that /proc/net/route works across Android platforms
and phones? I mean, sometimes companies like Motorola decide to apply
extra security measures to prohibit developers from accessing useful
platform functionalities, like routing tables.
Does anybody have knowledge about this?
BC
Post by Andreas Kostyrka
Routes: cat /proc/net/route
Dns: cat /system/etc/resolv.conf
netstat -nr just does the same as netstat, namely it lists the open >
TCP connections.
Sorry, correcting myself, it seems to list all open (IPv4?) sockets,
including UDP sockets and unconnected TCP sockets.
-- Simon. --~--~---------~--~----~------**------~-------~--~----~ You
received this message because yo...
--
You received this message because you are subscribed to the Google Groups
"android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/groups/opt_out.
--
biAji
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platform+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-platform-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...