Basic network configuration commands
1 Use the ifconfig command to see the network interface address
2 hostname change the hostname
3 using the route / netstat -r command to view the routing table entries
4 Use the netstat command to view the network connection
Common options
-a Displays current host network connection information for all activities
-n display information related to the host address and port in digital form
-r Displays the routing table information
-l display and network connection port information in the listening state
View -t tcp protocol-related information
-u Displays information related to the udp protocol
-p process ID associated with the display connected to the network, process name information
When viewing utp and tcp protocol, in order to show complete and options usually used with anp
5 ping command to test network connectivity
Format: ping [options] target host
Windows and different systems, the ping command of the Linux system will continue to send data packets to the target host, equivalent to the windows system plus -t ping command, CTRL + C must be forcibly terminated, and the windows system and the same data packet life cycle are 64
6 using the traceroute command tracking data packet routing path
Format: traceroute + IP destination address, the command which can be tested via the network between a node from the current host to the destination host, and displays the connection state of the intermediate node for network fault testing
7 Use the nslookup command to test DNS name resolution
This command will resolve domain names to ip address
Format: nslookup target host address DNS server address []
8 set network parameters
(1) Change of Address card
Temporary configuration does not permanently change will restore after restart, use the command ifconfig
Fixed configuration that is entering the configuration file changes
Command: vim / etc / sysconfig / network-scripts / ifcfg- card name
(2) disable and enable card
ifconfig network interface up
ifconfig network interface down
(3) set up a virtual network interface
Set up a virtual network interface that is more than a piece of card with ip address, you can access the server via ip address configuration
Format: ifconfig interface name: No. ip address
9 Set routing record route
(1) specify the network segment
(2) the default gateway