Network commands for Linux are organized in the update
1. Install the package:
Net-tools main commands: Netstat, ifconfig, route, Iptunnel
Iproute Main commands: ss, IP addr, ip route, IP tunnel
2.net-tools Series Main usage:
#查看本机开启的 Tcp[-t] udp[-u] listener [-l] port, in digital form [-n], display pid| process name [-p]# netstat-tunlpproto recv-q send-q Local Address F Oreign Address State Pid/program name TCP 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 25/httpd
#查看本机网络ip信息 #ifconfig eth0eth0: flags=4163<up,broadcast, running,multicast> mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 0.0.0.0 ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 5344 bytes 7795340 (7.4 mib ) RX errors 0 dropped 0 overruns 0 frame 0 tx packets 1157 bytes 78876 (77.0 kib) TX Errors 0 dropped 0 overruns 0 carrier 0 collisions 0
#查看本机路由信息 #routekernel IP Routing tabledestination Gateway genmask Flags Metric Ref use Ifacedefault Gateway 0.0.0.0 UG 0 0 0 eth0172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
Null
3.iproute Series Main usage:
#查看本机开启的 tcp4[-t4] monitoring [-l] port, [-n] display in digital form # ss -ln -t4Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp LISTEN 0 128 *:80 *:*
#查看本机网络ip信息 # IP Addr 34:eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc noqueue State up Link/ether 02:4 2:AC:11:00:02 BRD ff:ff:ff:ff:ff:ff inet 172.17.0.2/16 scope global eth0 Valid_lft forever Preferred_lft Forever
#查看本机路由信息 # ip Routedefault via 172.17.0.1 dev eth0 172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.2
Null
#
This article is from the "Frog Technology Archive" blog, so be sure to keep this source http://frogtwo.blog.51cto.com/3805708/1937385
Network commands for Linux are organized in the update