Linux for NIC batch configuration continuous IP

Source: Internet
Author: User

Added a new NIC
Cat/etc/udev/rules.d/70-persistent-net.rules
View the network card information as follows
# PCI Device 0x1022:0x2000 (Pcnet32)
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:aa:49:a0", attr{type}== "1", kernel== "eth*" , name= "Eth0"

# PCI Device 0x1022:0x2000 (Pcnet32)
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:aa:49:aa", attr{type}== "1", kernel== "eth*" , name= "Eth1"
The eth1 in the second paragraph is both our newly added NIC

Add a configuration file to him

Vi/etc/sysconfig/network-scripts/ifcfg-eth1
Write under the following content
Device=eth1
Hwaddr=00:0c:29:aa:49:aa
Onboot=yes
Type=ethernet
Save exit

Add an IP range configuration file

Vi/etc/sysconfig/network-scripts/ifcfg-eth1-range1
write the following content
device=eth1
bootproto=static
Hwaddr=00:0c:29:aa:49:aa
ipaddr_start=192.168.11.150
ipaddr_end=192.168.11.200
clonenum_start=1
# Clonenum_start Set the starting interface clone number for this IP segment
netmask=255.255.255.0
Onboot=yes
type=ethernet
Save Exit

Service Network restart restart NIC
Ifconfig good, already can see our newly configured NIC, eth1, Eth1:1 ~eth1:50
You can also ping the new IP with another machine

Reference: HTTP://WIKI.CENTOS.ORG/TIPSANDTRICKS/RANGEOFIPSONETHX

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.