ip addr flush def enp1s0 # flush enp1s0
sudo dhclient # again get ip
arp -a #manipulate the system ARP cache
netstat -a #Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships打印网络连接、路由表、接口统计、伪装连接和多播成员身份
nmap -sP 192.168.14.0/24 # Network exploration tool and security / port scanner
traceroute 192.168.43.14 # Trace the route to a host
tracepath 192.168.43.14 # traces path to a network host discovering MTU along this path
lsof - list open files
lsof -i:22 #查看22端口连接情况,默认为sshd端口
- netstat
netstat用来查看系统当前系统网络状态信息,包括端口,连接情况等,常用方式如下:
netstat -atunlp,各参数含义如下:
-t : 指明显示TCP端口
-u : 指明显示UDP端口
-l : 仅显示监听套接字(LISTEN状态的套接字)
-p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序
-n : 不进行DNS解析
-a 显示所有连接的端口