The operation is as follows, login ssh:
The code is as follows |
Copy Code |
vi/etc/sysconfig/network-scripts/ifcfg-eth0:0 |
The second IP is
The code is as follows |
Copy Code |
Vi/etc/sysconfig/network-scripts/ifcfg-eth0:1 |
The third IP is
Ifcfg-eth0:2 (by analogy)
The code is as follows |
Copy Code |
device=eth0:0 Network Card device Name Onboot=yes Random Boot Bootproto=static statically Assign IP Ipaddr=*.*.*.* the IP address to add netmask=255.255.255.0 Subnet Mask (Actual) Gateway=*.*.*.* Routing
|
If the IP is contiguous, you can use the following method.
The code is as follows |
Copy Code |
Vi/etc/sysconfig/network-scripts/ifcfg-eth0-range Device=eth0 Bootproto=static ipaddr_start= Start IP Ipaddr_end= End IP Clonenum_start= Network card starting number netmask= Subnet Mask Onboot=yes |
Saving the file and restarting the Network service takes effect.
VI Ifcfg-eth0:2
Then enter, the following content
The code is as follows |
Copy Code |
Device=eth0:2 Bootproto=static ipaddr=178.252.202.179 netmask=255.255.255.248 Onboot=yes |
Then execute the following command to enable 175.252.202.179 this IP
Ifup Eth0:2
Attention:
The variable names in the NIC configuration file such as device, and so on, all require uppercase. Configuring a different NIC requires only modification
DEVICE (device First name) ipaddr (IP address) NETMASK (subnet mask) these are 3.