How docker selects the ipv6 address segment

Release: 2020-04-03 11:57:14
Original
3490 people have browsed it

How docker selects the ipv6 address segment

Enable the service in the container to support IPv6

In fact, there is no need to allocate an IPv6 address. As long as the corresponding port is mapped, Docker will map the external IPv6 address port to the container's IPv4 port. So, just access the corresponding IPv6 port of the host.

Assign IPv6 address segment for Docker network

First, if you want to enable Docker's IPv6 support, you must ensure that your machine has an address segment of at least /80.

Edit the /etc/docker/daemon.json file and add the following content:

{
    "ipv6": true,
    "fixed-cidr-v6": "2001:db8:1::/64"
}
Copy after login

Among them, 2001:db8:1::/64 is the IPv6 address segment.

Use the following command to restart Docker.

systemctl restart docker
Copy after login

View the assigned IPv6 address (taking Debian/Ubuntu as an example)

Use the following command to view the IPv6 address segment assigned to the Docker network.

ifconfig
Copy after login

If you are prompted that the command cannot be found, please use the following command to install the network tool.

apt-get install net-tools
Copy after login

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How docker selects the ipv6 address segment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!