I. network-related commands in linux: the network configuration file is in etcsysconfignetwork-scr
1. network-related commands in linux: the network configuration file is in/etc/sysconfig/network-scripts.
Mii-tool-v.
Ethtool
Lscpu, lsusb, lsblk, and lspci-v to view information about each hardware.
1. ifconfig eth0 ip_address netmask net_mask modify the IP address and subnet mask of the NIC
2. ifconfig eth0 ip_address/24 configure the IP address and subnet mask
3. ifconfig eth0 down/up disable Nic, do not reload Nic configuration file/etc/sysconfig/network-scripts/ifcfg-eth0
4. ifconfig eth0 hw ether MAC_Address configure MAC address
5. ifconfig eth0: 1 IP_Address: configure the virtual network interface
6. configure the wireless network card in iwconfig.
7. View arp tables through arp-n
8. arp-s Ip_address Mac_address static binding MAC address
9. view the route table in route-n
10. traceroute
2. configure the linux system as a router:
1. enable route forwarding:
A. The routing and forwarding function of sysctl-w net. ipv4.ip _ forward = 1 is temporarily valid and cannot be restarted.
B. echo 1>/proc/sys/net/ipv4/ip_forward is temporarily valid and suitable for scripts.
C. modify the/etc/sysctl. conf file and change the variable value of net. ipv4.ip _ forward to 1. then enter sysctl-p to restart the configuration file.
2. add default routes and static routes
A. route add default gw IP_address add a default route.
B. delete the default route using route del default
C. route add-net network address gw IP_address add a static route.
D. route del-net network address gw Ip_address delete static route
E. vi/etc/sysconfig/network-scipts/route-eth0 and then add the static routing format in the file as follows:
Network/24 via IP_address is a permanent static route.
III. Solution to failure of Nic cloning for virtual machines.
1. clear the/etc/udev/rules. d/70-persistent-net.rules file.
2. delete the/etc/sysconfig/network-scipts/ifcfg-ethX file.
3. add a new NIC