11 月 292012
 

查看路由表(等同于route命令)
[root@oracle ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt

Iface
192.168.1.250 * 255.255.255.255 UH 0 0 0

eth0
192.168.2.0 * 255.255.255.0 U 0 0 0

eth0
link-local * 255.255.0.0 U 0 0 0

eth0
default 192.168.1.250 0.0.0.0 UG 0 0 0

eth0

查看接口状态
[root@oracle ~]# netstat -I
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP

TX-OVR Flg
eth0 1500 0 28458 0 0 0 2097 0 0

0 BMRU
lo 16436 0 4 0 0 0 4 0 0

0 LRU

查看TCP监听
[root@oracle ~]# netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address

State
tcp 0 0 *:amqp *:*

LISTEN
tcp 0 0 *:sunrpc *:*

LISTEN
tcp 0 0 *:ssh *:*

LISTEN
tcp 0 0 localhost:ipp *:*

LISTEN
tcp 0 0 localhost:smtp *:*

LISTEN
tcp 0 0 *:25501 *:*

LISTEN
tcp 0 0 *:amqp *:*

LISTEN
tcp 0 0 *:26509 *:*

LISTEN
tcp 0 0 *:sunrpc *:*

LISTEN
tcp 0 0 *:ssh *:*

LISTEN
tcp 0 0 localhost:ipp *:*

LISTEN
tcp 0 0 localhost:smtp *:*

LISTEN

查看UDP监听
[root@oracle ~]# netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address

State
udp 0 0 *:mdns *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:ipp *:*
udp 0 0 *:768 *:*
udp 0 0 *:48641 *:*
udp 0 0 *:904 *:*
udp 0 0 *:27576 *:*
udp 0 0 *:43629 *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:768 *:*
[root@oracle ~]#

查看UDP监听并以数字显示服务端口
[root@oracle ~]# netstat -lun
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address

State
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 0.0.0.0:631 0.0.0.0:*
udp 0 0 0.0.0.0:768 0.0.0.0:*
udp 0 0 0.0.0.0:48641 0.0.0.0:*
udp 0 0 0.0.0.0:904 0.0.0.0:*
udp 0 0 0.0.0.0:27576 0.0.0.0:*
udp 0 0 :::43629 :::*
udp 0 0 :::111 :::*
udp 0 0 :::768 :::*
[root@oracle ~]#

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)