Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand bridge Network

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to understand the bridge network, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Default bridge network

When Docker is installed, a linux bridge named docker0 is created. If you do not specify-- network, the containers created will be hung on the docker0 by default.

There are currently no other network devices on the docker0, so let's create a container and see what changes.

A new network interface veth38c57df is attached to docker0, and veth38c57df is the virtual network card of the newly created container.

Let's take a look at the container's network configuration.

The container has a network card eth0@if34. You may ask, why not veth38c57df?

Actually, eth0@if34 and veth38c57df are a pair of veth pair. Veth pair is a pair of special network devices, which can be thought of as a pair of network cards connected by a virtual network cable. One end of the network card (eth0@if34) is in the container, and the other end (veth38c57df) is hung on the bridge docker0. The effect is to hang the eth0@if34 on the docker0.

We also see that eth0@if34 has been configured with IP 172.17.0.2, why this network segment? Let's take a look at the configuration information of the bridge network through docker network inspect bridge:

The original subnet configured for the bridge network is 172.17.0.0Uniplex 16, and the gateway is 172.17.0.1. Where is this gateway? You've probably guessed it, it's docker0.

When the container is created, docker automatically allocates an IP from 172.17.0 IP 16, where the 16-bit mask ensures that enough IP is available for the container.

In addition to the three automatically created networks: none, host and bridge, users can also create user-defined networks according to business needs.

On how to understand the bridge network to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report