linux netstat 查看端口和已建立的链接
【摘要】 ECS信息规格:2vCPUs | 4GiB | kc1.large.2镜像:openEuler 20.03 64bit with ARM | 公共镜像 linux netstat 查看端口和已建立的链接 ip a 查看网卡信息地址已部分隐藏# ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN g...
ECS信息
- 规格:2vCPUs | 4GiB | kc1.large.2
- 镜像:openEuler 20.03 64bit with ARM | 公共镜像
linux netstat 查看端口和已建立的链接
ip a 查看网卡信息
- 地址已部分隐藏
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether XX:XX:XX:XX:b5:b8 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.XXX/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
valid_lft 54605sec preferred_lft 54605sec
inet6 XXXX::XXXX:XXXX:fe8d:XXXX/64 scope link
valid_lft forever preferred_lft forever
netstat -anp
- -a, --all display all sockets (default: connected)
- -n, --numeric don’t resolve names
- -p, --programs display PID/Program name for sockets
# netstat -aunp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:68 0.0.0.0:* 4584/dhclient
udp 0 0 127.0.0.1:323 0.0.0.0:* 1086/chronyd
udp6 0 0 ::1:323 :::* 1086/chronyd
# netstat -atnp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1924/sshd
tcp 0 36 192.168.0.81:22 115.171.251.96:56975 ESTABLISHED 10696/sshd: root [p
tcp 0 0 192.168.0.81:22 115.171.251.96:56976 ESTABLISHED 10772/sshd: root [p
tcp 0 0 192.168.0.81:40696 100.125.4.16:443 ESTABLISHED 2228/hostguard
tcp6 0 0 :::22 :::* LISTEN 1924/sshd
arp 查看arp记录
- 地址已部分隐藏
# arp -a
_gateway (192.168.0.1) at XX:XX:3e:0d:XX:dc [ether] on eth0
? (192.168.0.254) at fa:fa:fa:fa:fa:01 [ether] on eth0
学习资料
欢迎各位同学一起来交流学习心得^_^
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)