We need to edit the file.
The code is as follows |
Copy Code |
/etc/init.d/networking restart |
Locate the Ifcfg-eth0 file and duplicate a copy of the renamed Ifcgf-eth0:0″
The code is as follows |
Copy Code |
device=eth0:0 Onboot=yes Bootproto=static ipaddr=198.40.52.132 #IP netmask=255.255.255.224 #子掩码 gateway=198.40.52.129 #网关 |
The main card is the setting name, to be consistent with the filename, and modify your new IP and gateway.
Finally, reboot
The code is as follows |
Copy Code |
/etc/sysconfig/network-scripts/ifcfg-eth0 |
Linux VPS Bindings Add IP Address (Debian edition)
First of all, you have to modify the/etc/network/interfaces file, you can choose to use SFTP login to find file editing, or directly use VI to modify, but under Debian use VI seems not very convenient, recommended you install VIM, Here is no more explanation for the VI under Debian.
The following is an example of a interfaces file, added at the last line of carriage return.
The code is as follows |
Copy Code |
Auto Lo Iface Lo inet Loopback Auto Eth0 Iface eth0 inet Static Address 198.xxx.xxx.xxx Netmask 255.255.255.xx Gateway 198.xxx.xxx.xxx |
The way to add is as follows, auto and Iface are followed by the eth0:* mode input, * for the first few additional IP, the following is an example of adding content.
The code is as follows |
Copy Code |
Auto Eth0:1 Iface eth0:1 inet Static Address 198.xxx.xxx.xxx Netmask 255.255.255.xx Gateway 198.xxx.xxx.xxx |
When you have finished adding, restart the network.
code is as follows |
copy code |
Service Networking restart |