• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

0104-Linux常用命令网络相关

linux 搞代码 4年前 (2022-03-03) 21次浏览 已收录 0个评论

网络相干命令

ifconfig:查看网卡信息

[root@localhost chmod_test]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.112  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::6f25:133:e614:f7c4  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:b5:11:ba  txqueuelen 1000  (Ethernet)
        RX packets 1710  bytes 128876 (125.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 549  bytes 59638 (58.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 344 (344.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 344 (344.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ping:测试近程主机联通性

罕用形式:

  • ping -c 次数 IP地址:连贯多少次
  • ping -i 间隔时间 IP地址:每次 ping 的间隔时间
[root@localhost chmod_test]# ping -c 3 -i 3 www.baidu.com
PING www.baidu.com (14.215.177.39) 56(84) bytes of data.
64 bytes from www.baidu.com (14.215.177.39): icmp_seq=1 ttl=128 time=12.9 ms
64 bytes from www.baidu.com (14.215.177.39): icmp_seq=2 ttl=128 time=21.3 ms
64 bytes from www.baidu.com (14.215.177.39): icmp_seq=3 ttl=128 time=16.4 ms

--- www.baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 6021ms
rtt min/avg/max/mdev = 12.904/16.909/21.382/3.480 ms

netstat:打印网络连接情况、所凋谢的端口、路由表等信息

罕用形式:

  • netstat -ntpl:打印以后系统启动哪些端口

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:0104-Linux常用命令网络相关
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址