For commands related to viewing networks in ubuntu, refer to querying Nic addresses by IP address (arping IP address) Checking computer name nmblookup-a ip address (ifconfig eth0 | awk '/inet/{split ($2, x ,":"); print x [2]} 'view the IP address w3m-no-cookie-dump www.123cha.com | grep-o' [0-9]/{1, 3/}/of the current Internet /}/. [0-9]/{1, 3 /}/. [0-9]/{1, 3 /}/. [0-9]/{1, 3/} 'w3m-no-cookie-dump ip.loveroot.com | grep-O' [0-9]/{1, 3 /}/. [0-9]/{1, 3 /}/. [0-9]/{1, 3 /}/. [0-9]/{/} 'to view the program lsof-I listening for port 80: 80 view the physical address of the current Nic ifconfig eth0 | head-1 | awk '{print $5}' add a second IP address for the same Nic # Add a 1.2.3.4 IP address on the NIC eth0: sudo ifconfig eth0: 0 1.2.3.4 netmask 255.255.255.0 # Delete the added IP: sudo ifconfig eth0: 0 down immediately enable the network to support nat echo 1 | sudo tee/proc/sys/net/ipv4/ip_forward sudo iptables-t nat-I POSTROUTING-j MASQUERADE view route information netstat-rn sudo route-n manually add a route sudo route add-net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 manually delete a route sudo route del-net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1 how to modify the nic mac address sudo ifconfig eth0 down # disable sudo ifconfig eth0 hw ether 00: AA: BB: CC: DD: EE # Then change the sudo ifconfig eth0 up # then start the permanent address change method for the NIC sudo gedit/etc/network/interfaces and add a line after iface eth0 inet static: pre-up ifconfig eth0 hw ether 01: 01: 01: 01: 01: 01 the configuration file should be like the following iface eth0 inet static pre-up ifconfig eth0 hw ether 01: 01: 01: 01: 01: 01 address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 the last is logout or reboot statistics on the number of current IP connections netstat-na | grep ESTABLISHED | awk '{print $5}' | awk-F: '{print $1}' | sort | uniq-c | sort-r-n netstat-na | grep SYN | awk '{print $5}' | awk-F: '{print $1}' | sort | uniq-c | sort-r-n: the IP address tcpdump-tnn-c 20000-I eth0 of the current 100 IP Packets | awk-F ". "'{print $1 ". "$2 ". "$3 ". "$4} '| sort | uniq-c | sort-nr | awk' $1> 100 'blocked IPV6echo" blacklist ipv6 "| sudo tee/etc/modprobe. d/blacklist-ipv6 view current network connection status and program sudo netstat-atnp view network connection status netstat-n | awk '/^ tcp/{++ S [$ NF]} END {(a in S) print, S [a]} 'view all the listening ports of the current system nc-zv localhost 1-65535 view the current network traffic # install ethstatus software sudo apt-get install ethstatus # view the ADSL speed sudo ethstatus -I ppp0 # view the speed of the NIC sudo ethstatus-I eth0 # or install bwm-ng sudo apt-get install bwm-ng # view the current network traffic bwm-ng to view the domain name registration record whois baidu.cn view the Routing Status of a domain name tracepath baidu.cn re-obtain the IP address sudo dhclient from the server