For the first NIC:
(1) configure the nic ip address, modify the content of the/etc/sysconfig/network-scripts/ifcfg-eth0 file:
Device = eth0 # Physical device name
Bootproto = static # Static allocation
Broadcast = 255.255.255.255 # Broadcast address (optional)
Ipaddr = 192.168.1.103 # This is the static IP address you set
Netmask = 255.255.255.0 # Subnet Mask
Network = 192.168.1.0 # Network address (optional)
Hwaddr = 00: 0C: 29: 01: 98: 27 # MAC address
Gateway = 192.168.1.1 # Gateway address
Onboot = Yes # Whether to activate the device during boot
(2) configure the nic dns:
Modify the/etc/resolv. conf file:
Nameserver 202.109.14.5 # Primary DNS
Nameserver 219.141.136.10 # Secondary DNS
Search localdomain
(3) restart the network service:
Service Network restart
Or
/Etc/init. d/network restart
(4) Note: If you back up the/etc/sysconfig/network-scripts/ifcfg-eth0 file and back up it in the same directory (for example, back up the file name for the ifcfg-eth0_bak), so even if you configure the static IP address according to the above steps, restart the network service, it may also find that the IP address does not become your configured static IP address, what is going on? Because RHEL still reads the configuration of the ifcfg-eth0_bak file, so you can move this file to another folder, and then restart the network service to try, this time your static IP configuration takes effect, I have encountered this problem twice.