Configuration of multiple IP addresses for Ubuntu under single NIC

Source: Internet
Author: User

Delete User Default profile

Due to the default emptying, the configuration file is the system automatically generated user device profile saved under/etc/udev/rule.d/:
# Cp/etc/udev/rule.d/etc/udev/rule.d.bak.0-r
# rm/etc/udev/rule.d/*

Modify the NIC configuration file to add multiple IP configurations

#vim/etc/network/interfaces
Modify or add the following:

Auto Lo iface lo inet loopback auto eth0 iface eth0 inet static address192.168.76.192netmask255.255.255.0Gateway192.168.76.254Auto eth0:0iface eth0:0inet Static Address192.168.76.193netmask255.255.255.0Gateway192.168.76.254Auto eth0:1iface eth0:1inet Static Address192.168.76.194netmask255.255.255.0Gateway192.168.76.254  

Lab environment, I have added three IP addresses

Let the configuration take effect

#/etc/init.d/networking restart

Check effect

#ifconfig
eth0 Link encap:ethernet HWaddr-------------------------------
inet addr:192.168.76.192 Bcast : 192.168.76.255 mask:255.255.255.0
Inet6 addr:fe80::92e6:baff:fea0:b517/ Scope:link
up broadcast RUNNING multicast mtu:1500 metric:1
Span style= "color: #800080;" > RX packets:17278 errors:0 dropped:0 overruns:0 frame:0
TX packets:7044 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:8162087 (8.1 MB) TX bytes:1085377 (1.0 MB)
interrupt:30


eth0:0 Link encap:ethernet HWaddr-------------------------------
inet addr:192.168.76.193 bcast:192.168.76.255 mask:255.255.255.0
Up broadcast RUNNING multicast mtu:1500 metric:1
Interrupt:30


Eth0:1 Link encap:ethernet HWaddr-------------------------------
inet addr:192.168.76.194 bcast:192.168.76.255 mask:255.255.255.0
Up broadcast RUNNING multicast mtu:1500 metric:1
Interrupt:30


You can see three IP addresses, which indicates that the configuration was successful.

Configuration of multiple IP addresses for Ubuntu under single NIC

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.