Add multiple IPv6 addresses in batches for CentOS/Redhat/Fedora

Source: Internet
Author: User

Currently, IPv4 addresses are exhausted, but IPv6 addresses continue to flow. However, if the address is too large, it may be difficult to configure it. The following describes two methods to add IPv6 addresses in batches for CentOS, Fedora, and Redhat.

Suppose you want to add 2607: f0d0: 1002: 11: 10 to 2607: f0d0: 1002: 11: 50 41 IPv6 addresses in total

Method 1: Open/etc/rc. local and enter the command to add IPv6 addresses in batches.

Bash language:

# IP Alias
For ip in {10 .. 40}; do/sbin/ifconfig eth0 inet6 add 2607: f0d0: 1002: 11 ::: {ip}/64; done

Execute the command line and add it to rc. local. This will take effect after restart.

Method 2: Modify the/etc/sysconfig/network-script/ifcfg-eth0 and add the Secondary IPv6 address.

Bash language:

20176addr_secondaries = "2607: f0d0: 1002: 11: 10/64 \
2607: f0d0: 1002: 11: 11/64 \
2607: f0d0: 1002: 11: 12/64 \
2607: f0d0: 1002: 11: 13/64 \
2607: f0d0: 1002: 11: 14/64 ″

After adding the network, restart the network interface:

Bash language:

Service network restart

The preceding method adds IPv6 addresses in batches for CentOS, Redhat, and Fedora. Sometimes the newly added IPv6 address cannot be pinged immediately. wait a few minutes.

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.