访问手机版  

Linux常用命令|Linux培训学习|考试认证|工资待遇与招聘,认准超级网工!

招聘|合作 登陆|注册

网络工程师培训

当前位置:网络工程师 > 技术课程 > linux > 热点关注 > linux常用命令

Linux常用命令-网络类

时间:2019-11-10

linux常用命令_linux命令windows命令_常用linux命令大全

ip address 显示主机网卡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地址 检查与目标IP地址的连通性

[root@aspen ~]# ping 220.181.57.216     #与目标地址通信正常
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           #目标主机不可达
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地址 端口号 检测目标地址端口对应的TCP服务是否开启

[root@aspen ~]#telnet 10.0.0.201 22           #目标主机对应服务开启
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           #目标主机对应服务未开启
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.