Whether it's a Linux installation or a manual installation, Linux asks you questions about the network and configures the relevant software. The basic command for configuring the NIC is Ifconfig.
After the ifconfig command is executed, the system will set the necessary parameters in the kernel table so that Linux knows how to communicate with the NIC on the network. The Ifconfig command has the following two formats:
※ifconfig [Interface]
※ifconfig interface [aftype] option | Address ...
The first format of the ifconfig (or the ifconfig command with no arguments) can be used to view the network configuration of the current system.
After the system has just been installed, Linux is actually used without a NIC or network connection, but the ifconfig can be used to work in a wrapping way so that the computer thinks that it is working on the network.
Now let's run the Ifconfig command, and the Ifconfig command with no parameters can display the currently initiated network interface with the following output:
[Root@machine1/sbin] #ifconfig
Eth0 Link encap:ethernet hwaddr 52:54:ab:dd:6f:61
inet addr:210.34.6.89 bcast:210.34.6.127 mask:255.255.255.128
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:46299 errors:0 dropped:0 overruns:0 frame:189
TX packets:3057 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:5 Base Address:0xece0
Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Up loopback RUNNING mtu:3924 metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
The eth0 is led by the part of the Ethernet card configuration parameters, which shows the network card under the device name/dev/eth0 and hardware of the MAC address 52:54:ab:dd:6f:61,mac address is a manufacturer set, each network card has the only address.
However, we can manually change the MAC address of the NIC, as long as we add in the network in/etc/rc.d/init.d/:
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
Then restart, and then use the Ifconfig command to view, we will find that the MAC address of the network card has become xx:xx:xx:xx:xx:xx.
Subsequent common network card IP settings method:
Set directly through Setup.
Configure multiple NIC ifconfig-a view network device Eth0/eth1/lo (loop).
Ifconfig eth1//equipment 1
Ifconfig eth1 192.168.1.10 netmask 255.255.255.0//Set Network clamp network and IP
Mans Ifconfig
Ifconfig--help (T002)