Skip to content

Commit 398e3fd

Browse files
committed
add netstat display kernel route table.
1 parent ce4b544 commit 398e3fd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

bashrc/oneline_cmd

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22
netstat -pant | awk '/^tcp/ {++state[$6]} END {for(key in state) printf("%-10s\t%d\n", key,state[key])}'
33

44
# system route table
5+
# Routing tables
6+
#
7+
# Internet:
8+
# Destination Gateway Flags Refs Use Netif Expire
9+
# default 192.168.1.1 UGSc 107 0 en0
10+
# 127 127.0.0.1 UCS 0 0 lo0
11+
# 127.0.0.1 127.0.0.1 UH 8 5362 lo0
12+
# 169.254 link#4 UCS 0 0 en0
13+
# 192.168.1 link#4 UCS 0 0 en0
14+
# 192.168.1.1/32 link#4 UCS 1 0 en0
15+
# 192.168.1.1 ec:88:8f:2d:d4:74 UHLWIir 110 24 en0 1169
16+
# 192.168.1.106/32 link#4 UCS 0 0 en0
17+
#
18+
#
19+
# Kernel IP routing table
20+
# Destination Gateway Genmask Flags MSS Window irtt Iface
21+
# 10.103.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
22+
# 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
23+
# 10.0.0.0 10.103.11.254 255.0.0.0 UG 0 0 0 eth0
24+
#
25+
# Flags: U Indicates route is up;
26+
# G Route is to a gateway;
27+
# H Route is to a host and not a network;
28+
# M Table entry is modified by ICMP redirect message;
29+
# D Route was created dynamically or by ICMP redirect;
530
netstat -nr
631

732
# one line cmd display dir file.

0 commit comments

Comments
 (0)