Set IPv6 addresses in Linux

Source: Internet
Author: User
ArticleDirectory
    • Use "ip"
    • Use "ifconfig"
    • Use "ifconfig"
    • Use "ip"
    • Use "ifconfig"

In this document, the IPv6 address of Fedora 6 suddenly disappeared, and how to configure ifconfig is not enough.

# Ifconfig eth0 inet6 add fe80: 32ff: 2abe: fe63: 3eba/64 -- unable to load
# Ifconfig eth0 inet6 add 3ffe: 1/64 -- unable to load

When lsmod is used, the IPv6 module is also loaded. I don't know how to handle it.

Later, you can use the IP-6 command to load the IPv6 address, including the scope link and scope global address.

Run the following command:

#/Sbin/IP-6 ADDR add <rj6address>/<prefixlength> Dev <interface>

The following is a full text: useful.

6. Set IPv6 address 6.1 to print the current IPv6 address and use "ip"

Usage:

#/Sbin/IP-6 ADDR show Dev <interface>

Example: A static host address

#/Sbin/IP-6 ADDR show Dev eth02: eth0: <broadcast, multicast, up> MTU 1500 qdisc pfifo _ fast qlen 100inet6 fe80: 210: a4ff: fee3: 9566/10 scope linkinet6 3ffe: FFFF: 0: f101: 1/64 scope globalinet6 fec0: 0: 0: f101: 1/64 scope site

Automatically Set the address and its survival time:

#/Sbin/IP-6 ADDR show Dev eth0 3: eth0: <broadcast, multicast, promisc, up> MTU 1500 qdisc pfifo_fast qlen? 100 inet6 2002: d950: f5f8: f101: 2e0: 18ff: fe90: 9205/64 scope Global Dynamic valid_lft 16sec preferred_lft 6sec inet6 3ffe: 400: 100: f101: 2e0: 18ff: fe90: 9205/64 scope Global Dynamic valid_lft 2591997sec preferred_lft 604797sec inet6 fe80: 2e0: 18ff: fe90: 9205/10? Scope Link

Use "ifconfig"

Usage:

#/Sbin/ifconfig <interface>

For example, it only prints the IPv6 address:

#/Sbin/ifconfig eth0 | grep "inet6 ADDR:" inet6 ADDR: fe80: 210: a4ff: fee3: 9566/10 scope: linkinet6 ADDR: 3ffe: FFFF: 0: f101 :: 1/64 scope: globalinet6 ADDR: fec0: 0: 0: f101: 1/64 scope: Site

6.2 add an IPv6 address

The principle is the same as that of "ip alias" (IP alias) in IPv4.

Use "ip"

Usage:

#/Sbin/IP-6 ADDR add <rj6address>/<prefixlength> Dev <interface>

Example:

#/Sbin/IP-6 ADDR add 3ffe: FFFF: 0: f101 :: 1/64 Dev eth0

Use "ifconfig"

Usage:

#/Sbin/ifconfig <interface> inet6 add <rj6address>/<prefixlength>

Example:

#/Sbin/ifconfig eth0 inet6 add 3ffe: FFFF: 0: f101: 1/64

6.3 remove an IPv6 address

This is not commonly used. Do not use it to remove addresses that do not exist. Some early cores will be suspended because they cannot stand it.

Use "ip"

Usage:

#/Sbin/IP-6 ADDR del <rj6address>/<prefixlength> Dev <interface>

Example:

#/Sbin/IP-6 ADDR del 3ffe: FFFF: 0: f101 :: 1/64 Dev eth0

Use "ifconfig"

Usage:

#/Sbin/ifconfig <interface> inet6 del <rj6address>/<prefixlength>

Example:

#/Sbin/ifconfig eth0 inet6 del 3ffe: FFFF: 0: f101: 1/64

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.