linux检测主机网络配置和状况的命令是,linux 测试网络url命令

1.curl 地址 或者 wget url地址

curl www.baidu.com

返回结果如下

鐧惧害涓€涓嬶紝浣犲氨鐭ラ亾

wget www.baidu.com

返回结果如下

--2017-03-18 23:05:54-- http://www.baidu.com/

Resolving www.baidu.com... 220.181.112.244, 220.181.111.188

Connecting to www.baidu.com|220.181.112.244|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 2381 (2.3K) [text/html]

Saving to: 鈥渋ndex.html.1鈥

100%[=============================================================================================================================>] 2,381 --.-K/s in 0s

2017-03-18 23:05:54 (317 MB/s) - 鈥渋ndex.html.1鈥saved [2381/2381]

2.ping ip地址

ping www.baidu.com

返回结果如下

PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.

64 bytes from 220.181.111.188: icmp_seq=1 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=2 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=3 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=4 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=5 ttl=53 time=28.8 ms

64 bytes from 220.181.111.188: icmp_seq=6 ttl=53 time=28.8 ms

64 bytes from 220.181.111.188: icmp_seq=7 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=8 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=9 ttl=53 time=28.8 ms

64 bytes from 220.181.111.188: icmp_seq=10 ttl=53 time=28.7 ms

64 bytes from 220.181.111.188: icmp_seq=11 ttl=53 time=28.8 ms

3.telnet ip地址 端口地址

telnet www.baidu.com 80

返回结果如下

Trying 220.181.112.244...

Connected to www.baidu.com.

Escape character is '^]'.

^C

Connection closed by foreign host.

4.可以使用traceroute命令显示数据包到达目的主机所经过的路由

traceroute www.baidu.com

返回结果如下

traceroute to www.baidu.com (220.181.111.188), 30 hops max, 60 byte packets

1 * * *

2 11.240.157.150 (11.240.157.150) 4.258 ms 11.240.144.214 (11.240.144.214) 1.127 ms 11.240.163.246 (11.240.163.246) 4.312 ms

3 140.205.27.210 (140.205.27.210) 2.072 ms 42.120.244.237 (42.120.244.237) 2.452 ms 106.11.144.33 (106.11.144.33) 1.178 ms

4 42.120.247.98 (42.120.247.98) 2.800 ms 42.120.247.110 (42.120.247.110) 1.142 ms 42.120.247.66 (42.120.247.66) 22.146 ms

5 * * 115.238.21.114 (115.238.21.114) 0.980 ms

6 220.191.200.77 (220.191.200.77) 1.837 ms 220.191.200.73 (220.191.200.73) 7.704 ms 220.191.200.125 (220.191.200.125) 1.119 ms

7 * * 202.97.68.165 (202.97.68.165) 23.180 ms

8 * * *

9 * * *

10 220.181.182.26 (220.181.182.26) 23.839 ms 220.181.17.94 (220.181.17.94) 23.776 ms 220.181.17.150 (220.181.17.150) 29.032 ms

5.可以使用ifconfig命令来配置并查看网络接口的配置情况

ifconfig

返回结果如下:

eth0 Link encap:Ethernet HWaddr 00:16:3E:01:02:33

inet addr:10.45.54.21 Bcast:10.45.55.255 Mask:255.255.252.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:343207526 errors:0 dropped:0 overruns:0 frame:0

TX packets:100026499 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:57272669908 (53.3 GiB) TX bytes:142400917670 (132.6 GiB)

eth1 Link encap:Ethernet HWaddr 00:16:3E:01:13:EC

inet addr:114.55.11.127 Bcast:114.55.11.255 Mask:255.255.252.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1246009498 errors:0 dropped:0 overruns:0 frame:0

TX packets:945009458 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:304700165950 (283.7 GiB) TX bytes:339907719362 (316.5 GiB)

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:123 errors:0 dropped:0 overruns:0 frame:0

TX packets:123 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:7975 (7.7 KiB) TX bytes:7975 (7.7 KiB)

6.查看端口占用

netstat -an | grep 7064

返回结果如下

tcp 0 0 0.0.0.0:7064 0.0.0.0:* LISTEN

tcp 0 0 10.45.54.21:7064 100.97.54.29:6688 ESTABLISHED

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值