如何修改docker0网桥的IP段
- 修改/etc/docker/daemon.json
1 2 3
| { "bip": "10.10.80.1/24" }
|
如果已经有/etc/docker/daemon.json文件,添加内容的时候就只需要添加大括号里面的内容就好了,不需要另外添加大括号。
1
| ip link set dev docker0 down
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:cd:c4:39 brd ff:ff:ff:ff:ff:ff inet 172.16.8.16/24 brd 172.16.8.255 scope global ens33 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fecd:c439/64 scope link valid_lft forever preferred_lft forever 4: br-8c03afa71865: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:f0:b1:e4:fc brd ff:ff:ff:ff:ff:ff inet 172.18.0.1/16 brd 172.18.255.255 scope global br-8c03afa71865 valid_lft forever preferred_lft forever 92: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:a9:56:13:5d brd ff:ff:ff:ff:ff:ff inet 10.10.80.1/24 brd 10.10.80.255 scope global docker0 valid_lft forever preferred_lft forever inet6 fe80::42:a9ff:fe56:135d/64 scope link valid_lft forever preferred_lft forever
|