Configure dual-IP addresses for a single Nic in Ubuntu and centos 6.5

Source: Internet
Author: User

Configure dual-IP for Ubuntu

Sudo Vim/etc/Network/interfaces open the IP configuration file

 1 auto lo 2 iface lo inet loopback 3 auto eth0 4 iface eth0 inet static 5 #pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx  6 address 210.47.248.180 7 netmask 255.255.255.0 8 gateway 210.47.248.254 9 nameserver 8.8.8.810 auto eth0:011 iface eth0:0 inet static12 address 192.168.3.4013 netmask 255.255.255.0

Pre-up ifconfig eth0 HW ether is the cloned MAC address

Auto eth0: 0 indicates the added IP address.

Configure Dual IP addresses in centos 6.5

Sudo Vim/etc/sysconfig/network-scripts/ifcfg-Auto_eth0

 1 HWADDR=74:D0:2B:27:30:FF 2 TYPE=Ethernet 3 BOOTPROTO=none 4 IPADDR=210.47.248.171 5 PREFIX=24 6 GATEWAY=210.47.248.254 7 DNS1=8.8.8.8 8 DEFROUTE=yes 9 IPV4_FAILURE_FATAL=yes10 IPV6INIT=no11 NAME="Auto eth0"12 UUID=3baad9b7-be6c-419b-bfff-c19a3ff1fe6013 ONBOOT=yes14 LAST_CONNECT=140567100515 IPADDR2=192.168.3.416 PREFIX2=24

Ipaddr2 and prefix2 are added as IP addresses. The prefix value is 24, which is equivalent to the subnet mask 255.255.255.0.

Configure dual-IP addresses for a single Nic in Ubuntu and centos 6.5

Related Article

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.