Add multiple ip addresses to a single Nic in linux

Source: Internet
Author: User

 

1. First, let's check the network configuration in the system.

Command: ifconfig

2. in linux, the NIC is called eth0, eth1, eth2...... all the NIC configuration files are stored in/etc/sysconfig/network-script. The file name is named after 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) Go to the NIC configuration file directory:

Cd/etc/sysconfig/network-scripts/

View your Nic configurations:

(2) run the following command to configure a virtual Nic device:

Vi ifcfg-eth0: 0 write the commands shown below in your configuration file case sensitive

Before editing, enter edit mode and press I.

After editing, save the command: (: wq) and exit and save

(3) restart the network configuration to take effect:

Service network restart

In this case, OK. Check the two ip addresses.

,

This article is from the "learning network path" blog

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.