How to customize the network bridge in centos environment

藏色散人
Release: 2021-03-05 15:48:06
forward
2263 people have browsed it

The following tutorial column from centos will introduce to you how to customize the network bridge in the centos environment. I hope it will be helpful to friends in need!

1. Stop the docker service and delete the old bridge

service docker stop
ip link set dev dev bridge0 down
brctl delbr docker0
Copy after login

2. Create a new bridge docker0 and configure its IP address

brctl addbr bridge0                      //添加新网桥,bridge0为新网桥的名称
ip addr add 192.168.1.100/24 dev bridge0          //为网桥配置IP地址,此处可以将IPv4地址替换为IPv6地址,也可分两次为该网桥分别添加IPv4和IPv6地址
ip link set dev bridge0 up           //启动网桥
Copy after login

3. Modify the docker configuration file and bridge to the created bridge by default

Add configuration options in the docker-network file

echo 'DOCKER_OPTS="-b=bridge0" ' >> /ect/sysconfig/docker-network
Copy after login

4. Start the docker service

service docker start
Copy after login

5. Create a new container and check whether the IP address of the container is in the same C as the bridge address. part

The above is the detailed content of How to customize the network bridge in centos environment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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!