Linux VPS Bindings Add IP Address (Debian edition) detailed

Source: Internet
Author: User
Tags vps

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.