1.ifconfig Viewing and configuring network interface information
(1) Set IP address
Ifconfig eth0 192.168.0.1
(2) Temporarily turn off or enable the NIC
Ifconfig eth0 Down
Ifconfig eth0 up
(3) Set subnet mask
Ifconfig eth0 netmask 255.255.255.0
(4) View the status of the first NIC
Ifconfig eth0
2.route Manage routing tables, set up static routes
Add adds a route table entry
Del Deletes a route table entry
-C Display Kernel middle cache information
-F Show Route fib routing table
(1) Add a route table entry
Route add-net 192.168.0.0 netmask 255.255.255.0 Dev eth0
(2) Add a default route
Route add 0.0.0.0 GW
(3) Delete the default route
Route del 0.0.0.0 GW
3.netstat command
List all UDP ports: Netstat-au
List all TCP ports: Netstat-at
Show only listening ports: netstat-l
List all ports listening on TCP: NETSTAT-LT
PID and process name shown in output: netstat-p
4.nslookup command
The function of the nslookup command is to query the IP address of a machine and its corresponding domain name. It usually requires a domain name server to provide the domain name service.
Usage: NSLOOKUP[IP address/Domain name]
5.host command
The function of the host command is basically the same as Nslookup. The root hostname queries the host's IP address or queries the hostname based on the host IP address.
Usage: host [options] [IP address/domain name/host name]
Common parameters are-a: Displays information about the domain name or IP address, domain name, or hostname you are looking for.
6.finger command
The function of the finger command is to query the user for information.
Parameters:
-L: Multi-line display
-S: Single-line display
Lists information about the currently logged on user: Finger-l
7.ping command
The ping command is used to see if a host on the network is working. It sends a packet to the host to determine if the host is alive.
Usage: Ping IP address
Linux Security essentials: Network Configuration commands