I. Viewing network configuration information
View IP address information
Ifconfig (View active network configuration information)
Ifconfig eth0 (view specified NIC information)
Ifconfig-a (View all network card information)
View routing table information (default gateway)
Route-n
View Host Name
Hostname
Test network connectivity
Ping
Tracking Network nodes
Traceroute
Test DNS resource records
Nslookup
Viewing TCP and UDP port information
Netstat-anptu
-A: Displays all active network connection information in the current host
-N: Displays the associated host address in digital form, port information
-R: Show routing table information
-L: Display network connection and port information in listening state
-T: View TCP Information
-U: Display UDP information
-P: Shows the process number associated with the network connection, process name information
Two. Setting up network information (temporary)
1. Configure IP address information
Ifconfig eth0 IP Address
Ifconfig eth0:1 IP address (virtual interface)
2. Configure the default gateway
Add route Add default GW gateway address
Delete route del default GW gateway address
3. Modify Host Name
Hostname Host Name
Three. Set up network information (permanent)
Modify the IP address and gateway configuration file
/etc/sysconfig/network-scripts/ifcfg-eth0
Configuration Item Meaning:
DEVICE: Sets the name of the network interface
Onboot: Set whether the network interface is activated at Linux startup
Bootproto: How to set the network interface (static: Static DHCP: Auto Get)
IPADDR: Set the IP address of the network interface
NETMASK: Subnet Mask
Gaterway: Gateway Address
Configure Restart Network service or Ifdown eth0;ifup eth0 (This is a command)
2. Modify Host Name
/etc/sysconfig/network
Restart the server when you are done changing
3. Configure the NDS server address
/etc/resolv.conf
Add NameServer 202.106.0.20 (one per line)
This article is from the "Carey" blog, make sure to keep this source http://careygg.blog.51cto.com/11084669/1737929
Linux Basic network Settings