Common Network Management commands (part I)
Ifconfig: network interface configuration command
Command syntax:
Ifconfig: displays all active interface information
Ifconfig [interface]: displays the specified interface information
Example: ifconfig eth0
Ifconfig [interface] [up | down]: temporarily starts or shuts down the specified network interface
Example: ifconfig eth0 down
Ifup eth0:1
Ifdown
Ifconfig [interface] [ipaddr] netmask [mask]: temporarily configure ip address
Example: ifconfig eth0:0 192.168.10.1 netmask 255.255.255.0
Ifconfig eth2 192.168.100.1/24
Route: routing table management command
Command syntax:
Route: displaying routing information
-n: address in numeric format
Route add: adding routing information
-host: destination host rout
Example: route add-host 10.0.0.5 gw 192.168.0.1
-net: destination network rout
Example: route add-net 172.0.0.0Plus 24 gw 192.168.1.1
Route add-net 0.0.0.0 gw 10.0.0.1
Route add default gw 10.0.0.1
Route del: deleting routing information
-host: destination host rout
Example: route del-host 10.0.0.1
-net: destination network rout
Example: route del-net 172.0.0.0According to 24
Netstat: view the network and related information
-t: display tcp information
-u: displays udp information
-p: displays process information
-l: displays monitoring information
-n: do not parse the host name
-a: show all information
-e: display extended information
-m: displays socket-related memory usage information
-o state: only connections in the specified state are displayed, and filter criteria can be specified
Example: netstat-anpu
Ping: a Network testing tool based on ICMP Protocol
Command syntax:
Ping [destination]:
-c: number of messages
Example: ping-c 1 192.168.1.1
-W: timeout for waiting for a response message
Example: ping-W 1 10.0.0.1
Traceroute: tracks all gateways through which network packets reach the target host, depending on the traceroute package
Command syntax:
Traceroute [destination]:
Example: traceroute www.baidu.com
Mtr: network diagnostic tool, similar to traceroute, dependent on mtr software package
Command syntax:
Mtr [destination]:
Example: mtr www.baidu.com
Nslookup: the resolution correspondence between domain name and IP, depending on bind-utils software package
Command syntax:
Nslookup [destination]
Example: nslookup www.baidu.com
Nslookup 220.181.112.244
Hostname: displays or configures the system hostname
Command syntax:
Hostname: displays the host name of the host
Hostname [hostname]: change the native hostname
Example: hostname princepar.blog.51cto.com
Ethtool: displays attribute information for network interface devices
Command syntax
Ethtool [devname]:
Example: ethtool eth0
Ethtool-S [devname]: data information for statistical device interfaces
Example: ethtool-S eth0
Can be used with the watch command: watch "ethtool-S eth0"