Set dual IP addresses for a single NIC in Centos

Source: Internet
Author: User
1. configure the first IP address in Linux: [root @ Linuxroot] # cd/etc/sysconfig/network-scripts [root @ Linuxnetwork-scripts] # viifcfg-eth0DEVICE = eth0BOOTPROTO = static

1. configure the first IP address in Linux:


[Root @ Linux root] # cd/etc/sysconfig/network-scripts


[Root @ Linux network-scripts] # vi ifcfg-eth0


DEVICE = eth0


BOOTPROTO = static


BROADCAST = 192.168.80.255 // * BROADCAST address *//


IPADDR = 192.168.80.189 // * The first IP address *//


NETMASK = 255.255.255.0 // * network mask *//


NETWORK = 192.168.80.0 // * NETWORK segment *//


ONBOOT = yes


: Wq // * save and exit *//


2. copy the first IP address configuration file to the second IP address configuration file and modify the IP address:


[Root @ Linux network-scripts] # cp ifcfg-eth0 ifcfg-eth1


[Root @ Linux network-scripts] # vi ifcfg-eth1


DEVICE = eth0


BOOTPROTO = static


BROADCAST = 192.168.80.255 // * BROADCAST address *//


IPADDR = 192.168.80.199 // * Second IP address *//


NETMASK = 255.255.255.0 // * network mask *//


NETWORK = 192.168.80.0 // * NETWORK segment *//


ONBOOT = yes


: Wq // * save and exit *//

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.