Linux Network configuration Ethernet connection in Linux, the Ethernet interface is named: eth0, eth1, etc., 0, 1 represents the network card number
Pass
LSPCI command to view NIC hardware information(if it is a USB card, you need to use the LSUSB command)
Command
ifconfig to view interface information
Ifconfig-a View All interfaces
Ifconfig Interface Name eth0 View information for a specific interface
Command Ifup, Ifdown to enable, disable an interface
Ifup eth0
Ifdown eth0
Configure Network information Use the Setup command to configure network information
Network-related profile NIC configuration file (this file is not available in this directory of Ubuntu)
/etc/sysconfig/network-scripts/ifcfg-eth0
DNS configuration file
/etc/resolv.conf
Host name configuration file
/etc/sysconfig/network
Static Host name configuration file
/etc/hosts
Network Test commands
Test network Connectivity:
Ping 192.168.1.1
Ping www.baidu.com
Test DNS Resolution:
Host www.google.com
Dig www.google.com
The result of the host command is simple, just show the IP address of the domain name
The dig command displays a relatively detailed result.
Show route Table
IP route
track the network path to the destination address
Traceroute www.google.com
using MTR for network quality testing(combined with tracerout and ping)
Troubleshooting network troubleshooting follows a process from the bottom to the top, from itself to the outside.
Check that the network configuration information is correct first:
IP Address
Subnet mask
Gateway
Dns
Check to see if the gateway is connected:
Ping Gateway IP Address
To see if DNS resolution is OK:
Host www.google.com
Linux Getting Started basic--linux network configuration