How to configure multiple IP addresses for a network card in Linux

Source: Internet
Author: User
Article Title: how to configure multiple IP addresses for a network card in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

We know that in Linux, NICs are called eth0, eth1, eth2 ......, All Nic configuration files are stored in/etc/sysconfig/network-script/, the file name is ifcfg-eth0, ifcfg-eth1, ifcfg-eth2 ...... . A Nic corresponds to a configuration file. What should we do if we want to configure two IP addresses for eth0?
 
1. Execute "cp ifcfg-eth0 ifcfg-eth0: 1" to copy the configuration file of eth0, the file name is added after the original file name ": 1 ".
 
2. Edit the field in modify ifcfg-eth0: 1 as follows:

# VIA Technologies, Inc. VT6102 [Rhine-II]
DEVICE = eth0 // The DEVICE must be changed to eht0: 1.
BOOTPROTO = none
BROADCAST = 192.168.1.255 // BROADCAST address of the IP address, corresponding
HWADDR = 00: 14: 2A: 2D: 59: 6B // the Mac address of the NIC, which does not need to be modified.
IPADDR = 192.168.1.17 // change the IP address to the one you want
IPV6INIT = yes
IPV6_AUTOCONF = yes
NETMASK = 255.255.255.0 // subnet mask, corresponding
NETWORK = 192.168.1.0 // NETWORK address, corresponding
ONBOOT = yes
GATEWAY = 192.168.1.1 // The GATEWAY address.
TYPE = Ethernet
PEERDNS = yes
USERCTL = no
 

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.