解决
什么是 /etc/modules-load.d/
/etc/modules-load.d/ 目录包含在系统启动时自动加载内核模块的配置文件。
docker-net.conf 文件内容
Docker 网络相关的配置文件可能包含以下模块:
1 2 3 4 5 6 7 8
| # 加载 Docker 网络相关模块 bridge veth ip_tables iptable_nat iptable_filter nf_nat nf_conntrack
|
根据实际情况不同操作系统依赖内核模块名字存在不一样。
重新加载模块的方法
1. 重启系统服务
1 2 3 4 5
| sudo systemctl restart systemd-modules-load
sudo systemctl restart docker
|
2. 手动加载模块
1 2 3 4
| sudo modprobe bridge sudo modprobe veth sudo modprobe ip_tables
|
3. 卸载并重新加载模块
1 2 3 4 5 6 7
| sudo rmmod bridge veth ip_tables
sudo modprobe bridge sudo modprobe veth sudo modprobe ip_tables
|
4. 检查模块状态
1 2 3 4 5
| lsmod | grep -E "bridge|veth|iptable"
modinfo bridge
|
验证 Docker 网络
重新加载后,验证 Docker 网络是否正常工作:
1 2 3 4 5 6 7 8 9
| docker network ls
docker network create test-network
ip link show brctl show
|