常用的幫助診斷網絡問題的工具有ping, arp, netstat, ifconfig, wireshark等。 請注意有些工具已經被更新的工具代替了。 這是一個簡單的列表:
net-tools utilities obsoleted by iproute2
Legacy utility | Obsoleted by | Note |
---|---|---|
ifconfig | ip addr, ip link, ip -s | Address and link configuration |
route | ip route | Routing tables |
arp | ip neigh | Neighbors |
iptunnel | ip tunnel | Tunnels |
nameif | ifrename, ip link set name | Rename network interfaces |
ipmaddr | ip maddr | Multicast |
netstat | ip -s, ss, ip route | Show various networking statistics |
我們看到, 現在ip 和 ss 兩個命令就可以代替以前的好幾個命令。
ss 類似netstat,用來顯示套接字的信息,不過功能更強大。 這是詳細的使用方法:
http://blog.csdn.net/yuwen_dai/article/details/78467686
還有一些比較有用的工具:
nping 屬於nmap項目,比ping更靈活。可以指定udp, tcp, icmp, arp等。 這是
一個例子:
nping -c1 --tcp --dest-port 674 --source-ip 239.29.168.63 172.25.52.103
發ARP request:
nping -c1 --arp --arp-type arp 172.25.52.103
fping 可以同時ping 若干臺主機:
fping -c1 -g 172.25.52.0/24
可以只顯示可達的主機:
fping -c1 -g 172.25.52.0/24 2> /dev/null