ip address 顯示主機(jī)網(wǎng)卡IP地址
[root@aspen ~]# ip a s eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:c4:ff:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.200/24 brd 10.0.0.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::7f33:52f3:3051:7cb9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
ping IP地址 檢查與目標(biāo)IP地址的連通性
[root@aspen ~]# ping 220.181.57.216 #與目標(biāo)地址通信正常
PING 220.181.57.216 (220.181.57.216) 56(84) bytes of data.
64 bytes from 220.181.57.216: icmp_seq=1 ttl=128 time=7.59 ms
64 bytes from 220.181.57.216: icmp_seq=2 ttl=128 time=9.30 ms
64 bytes from 220.181.57.216: icmp_seq=3 ttl=128 time=9.64 ms
64 bytes from 220.181.57.216: icmp_seq=4 ttl=128 time=8.38 ms
--- 220.181.57.216 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3007ms
rtt min/avg/max/mdev = 7.592/8.733/9.646/0.807 ms
[root@aspen ~]# ping 10.0.0.2 #目標(biāo)主機(jī)不可達(dá)
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
From 10.0.0.201 icmp_seq=1 Destination Host Unreachable
From 10.0.0.201 icmp_seq=2 Destination Host Unreachable
From 10.0.0.201 icmp_seq=3 Destination Host Unreachable
From 10.0.0.201 icmp_seq=4 Destination Host Unreachable
--- 10.0.0.2 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4002ms
pipe 4
telnet IP地址 端口號(hào) 檢測(cè)目標(biāo)地址端口對(duì)應(yīng)的TCP服務(wù)是否開(kāi)啟
[root@aspen ~]#telnet 10.0.0.201 22 #目標(biāo)主機(jī)對(duì)應(yīng)服務(wù)開(kāi)啟
Connecting to 10.0.0.201:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
SSH-2.0-OpenSSH_7.4
[root@aspen ~]#telnet 10.0.0.201 23 #目標(biāo)主機(jī)對(duì)應(yīng)服務(wù)未開(kāi)啟
Connecting to 10.0.0.201:23...
Could not connect to '10.0.0.201' (port 23): Connection failed.
Type `help' to learn how to use Xshell prompt.
上一個(gè)教程:Linux VPS查看系統(tǒng)信息命令大全
下一個(gè)教程:linux命令中的“