Ubuntu System Add IP

Source: Internet
Author: User

By default, we buy the server will give us more than 5 IP, the general host has a master IP, if you want to add 4 remaining IP to the host, you need to manually configure, the specific operation is

Open Vim/etc/network/interfaces

Default is

Auto Lo
Iface Lo inet Loopback
Auto Eth0
Iface eth0 inet Static
Address 8.8.8.8 (based on your IP)
Netmask 255.255.255.248
Gateway 8.8.8.8 (according to your own getway)

To add it again, plus

Auto Eth0:1
Iface eth0:1 inet Static
Address 8.8.8.8 (based on your IP)
Netmask 255.255.255.248
Gateway 8.8.8.8 (according to your own getway)

Auto Eth0:2
Iface eth0:2 inet Static
Address 8.8.8.8 (based on your IP)
Netmask 255.255.255.248
Gateway 8.8.8.8 (according to your own getway)

And so on

Save after adding, restart

/etc/init.d/networking restart

Ok

Errors that you may encounter

/etc/init.d/networking Restart Error analysis case:
[Email protected]www.ctohome.com:/etc/network#/etc/init.d/networking Restart
* Reconfiguring network Interfaces ...
/etc/network/interfaces:165:interface Eth0:28 declared Allow-auto twice
IFDOWN:COULDN ' t read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:165:interface Eth0:28 declared Allow-auto twice
IFUP:COULDN ' t read interfaces file "/etc/network/interfaces"
... fail!

Description eth0:28 Duplicate, Solution: VI interfaces Find eth0:28, delete the duplicate

[Email protected]www.ctohome.com:/etc/network#/etc/init.d/networking Restart
* Reconfiguring network Interfaces ...
/etc/network/interfaces:166:duplicate interface
IFDOWN:COULDN ' t read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:166:duplicate interface
IFUP:COULDN ' t read interfaces file "/etc/network/interfaces"
... fail!

Description 166 lines have duplicates, workaround: VI Interfaces Find 166 rows (set number), delete the duplicate

[Email protected]www.ctohome.com:/etc/network#/etc/init.d/networking Restart
* Reconfiguring network Interfaces ...
/etc/network/interfaces:162:duplicate interface
IFDOWN:COULDN ' t read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:162:duplicate interface
IFUP:COULDN ' t read interfaces file "/etc/network/interfaces"

Description 162 lines have duplicates, workaround: VI Interfaces Find 166 rows (set number), delete the duplicate

Ubuntu System Add IP

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.