In Linux, the Ethernet interface is named: Eth0,eth1, and so on. 0, 1 represents the NIC number.
To view the network card information, you can use the Ifconfig command
Ifconfig-a View All interfaces
Ifconfig eth0 Viewing specific interfaces
To turn the NIC on and off:
Ifup eth0 turn on the NIC Eth0
Ifdown eth0 Turn off the NIC Eth0
The NIC is not visible in ifconfig after it is closed
The Setup command can be used to configure the network in Centos/redhat, and a GUI-like configuration interface is created when the Setup command is entered on the command line:
In Ubuntu this is not the default.
Network-related configuration files:
Nic Profile:/etc/sysconfig/network-scripts/ifcfg-eth0 Ubuntu is:/etc/network/interfaces
DNS configuration file:/etc/resolv.conf
Hostname configuration file:/etc/sysconfig/network
static hostname configuration file:/etc/hosts
Test commands commonly used in the network:
Ping IP ping does not have to be explained, the test network is
Host www.xxx.com Test DNS resolution
Dig www.xxx.com is also a test for DNS resolution, and the information displayed is more detailed
Route shows the routing table (This is also used for configuration routing)
Traceroute www.xxx.com tracks the network path to the destination address (many on the public web are not tracked)
MTR www.xxx.com This command is used to test the quality of the network (actually combining ping and traceroute)
linux-Network Connections in Linux