宿主机
root@MXD-PC-3:~# ifconfig
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.53.1 netmask 255.255.255.0 broadcast 192.168.53.255
inet6 fe80::42:b4ff:fe2b:40f1 prefixlen 64 scopeid 0x20<link>
ether 02:42:b4:2b:40:f1 txqueuelen 0 (Ethernet)
RX packets 5309 bytes 3435354 (3.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5709 bytes 4015130 (3.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.1.22 netmask 255.255.255.0 broadcast 172.17.1.255
inet6 2409:8a60码住::22 prefixlen 64 scopeid 0x0<global>
inet6 2409:8a60:码住::177 prefixlen 64 scopeid 0x0<global>
inet6 fe80::2e0:码住05 prefixlen 64 scopeid 0x20<link>
inet6 2409:8a60:码住:6b05 prefixlen 64 scopeid 0x0<global>
ether 00:e0:4c:58:6b:05 txqueuelen 1000 (Ethernet)
RX packets 6814064 bytes 6177692002 (5.7 GiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 5219321 bytes 4827387237 (4.4 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 23103 bytes 4224573 (4.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23103 bytes 4224573 (4.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth81b2185: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.187.2 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::b0b6:7fff:fe41:ac0b prefixlen 64 scopeid 0x20<link>
ether b2:b6:7f:41:ac:0b txqueuelen 0 (Ethernet)
RX packets 3019 bytes 1782815 (1.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3682 bytes 877513 (856.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Docker配置
root@MXD-PC-3:~# docker network inspect bridge
[
{
"Name": "bridge",
"Id": "022816b2096aa1fd8d81dc2c1e47aaa3493d65764b144f3c5a3ea51b8a484c48",
"Created": "2024-08-19T15:48:42.796941312+08:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "192.168.53.0/24",
"Gateway": "192.168.53.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"7eb8e5c493b096009cf22d04cc693c2af8a0e4787ccc95f51bcedb47ec494a5b": {
"Name": "oryx",
"EndpointID": "a1822693da548b4ef0d028e9154fa1fa9d516c32f59aaf559eacafa8270c7db6",
"MacAddress": "02:42:c0:a8:35:02",
"IPv4Address": "192.168.53.2/24",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
/etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.mxdyeah.top"
],
"bip":"192.168.53.1/24"
}