Centos Nic-related commands

Source: Internet
Author: User
Tags dmesg
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.