Commands for Nic operations: 1. lsmod check whether the Nic module is loaded and whether the NIC driver is good. 2. dmesg: Check whether the NIC is detected. 3. ifupifdown enable/Stop the Nic 4. ifconfig check whether the NIC works properly. Check whether the NIC has an ip address and the lo host returns to the network, indicating that the device is correct. The ipconfig/all command is displayed in windows,
Commands for Nic operations:
1. lsmod check whether the Nic module is loaded and whether the NIC driver is good.
2. dmesg: Check whether the NIC is detected.
3. ifup ifdown
4. ifconfig to check whether the NIC works properly. Check whether the NIC has an ip address and the lo host returns to the network, indicating that the device is correct.
In windows, the ipconfig/all command is used. in centosIs the ifcofnig command
Ifconfig interface
Ifconfig eth0 (interface) up/downEnable the Nic device. The NIC is invalid.
Ifconfig eth0 netmask mask 255.254.0 set mask
Ifconfig eth0Set the eth0 IP address to 0.21 at 192.168.0.21.
You can also write a row: ifconfig eth0 192.168.0.21 netmask 255.255.255.0
After modification, you need to restart the network settings: service network restart
5. check whether the network is connected.
Ping-c 10 (Echo Times) ip/domain name
Eg: ping-c 192.168.1.1Same as windows.
6. if the network cannot be accessed, check whether the dns is correctly filled in:/etc/resolv. conf file.
7. if you do not go to the Internet, check that the default route settings are incorrect.
The route command is designed:
Route: Check whether the default gateway is the IP address of your vro. if it is not, it cannot be connected to the network. you need to modify the gateway. how can you modify it? Delete the default route first. Then add the default route entry. You can.
Route del default
Route add default gw 192.168.0.254 (the ip address of your router), which can be operated only by the root user.