linux netstat 查看端口和已建立的链接

网友投稿 885 2022-05-30

ECS信息

规格:2vCPUs | 4GiB | kc1.large.2

镜像:openEuler 20.03 64bit with ARM | 公共镜像

linux netstat 查看端口和已建立的链接

地址已部分隐藏

# ip a 1: lo: 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: 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

-a, --all display all sockets (default: connected)

linux netstat 查看端口和已建立的链接

-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 -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

学习资料

弹性云服务器 ECS

openEuler-官网

openEuler-B站

openEuler-慕课

openEuler-文档

鲲鹏社区

欢迎各位同学一起来交流学习心得^_^

Linux openEuler

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:如何从GitHub上面下载一个项目到ModelArts上面运行
下一篇:JavaScript 常用输出语句 及 数据与运算
相关文章