Edit the ifcfg-eth0 file under/etc/sysconfig/networking-scripts/(if not, determine whether the NIC driver is installed)
Cd/etc/sysconfig/network-scripts
Vi ifcfg-eth0
--------------------------------------------
DEVICE = eth0
BOOTPROTO = none
IPADDR = 192.168.110.20.
NETMASK = 255.255.255.0
GATEWAY = 192.168.110.20.
DNS1 = 8.8.8.8
ONBOOT = yes
HWADDR = 50: e5: 49: ce: 27: e8
TYPE = Ethernet
Save as needed
Restart the NIC: ifdown eth0
Ifup eth0
Notify the gateway to update the information if necessary.
/Etc/init. d/network restart
Bytes ------------------------------------------------------------------------------------------
Summary:
1. Temporary Dynamic ip address Modification
Terminal command: ifconfig eth0 10.10.21.149
The ip address of the eth0 Nic is changed to 10.10.21.149, which takes effect immediately after modification. However, the ip address becomes invalid after the machine is restarted.
2. static ip address Modification
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE = eth0
# Physical device name
ONBOOT = yes
# [Yes | no] whether to activate the device during boot
BOOTPROTO = static # none: protocol not used during boot, static: static allocation, bootp: BOOTP protocol, dhcp: DHCP protocol
IPADDR = 192.168.0.3 # IP Address
NETMASK = 255.255.255.0 # mask
GATEWAY = 192.168.0.1 # GATEWAY address