How to Set Dual IP addresses with a single Nic in Linux

Source: Internet
Author: User

How to Set Dual IP addresses with a single Nic in Linux.
1. Set the first IP Address:
[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 *//

3. Restart the NIC:
[root @ Linux Network-Scripts] # service network restart
or:
[root @ Linux Network-Scripts] # ifdown eth0
[root @ Linux Network-Scripts] # IFUP eth0
or
[root @ Linux Network -Scripts] # ifconfig eth0 down
[root @ Linux Network-Scripts] # ifconfig eth0 up
This article is from: it Knowledge Network (http://www.itwis.com) detailed source reference: http://www.itwis.com/html/ OS /linux/20090912/6196.html

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.