admin 发表于 2018-6-21 10:55:24

ubuntu下修改docker网卡默认信息

要修改docker默认网卡信息
root@dockerserver:/etc/docker# ifconfig docker0
docker0   Link encap:EthernetHWaddr 02:42:f7:b3:25:a8
          inet addr:172.17.0.1Bcast:0.0.0.0Mask:255.255.0.0
          inet6 addr: fe80::42:f7ff:feb3:25a8/64 Scope:Link
          UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:536 (536.0 B)TX bytes:648 (648.0 B)

# vim /etc/docker/daemon.json    #添加一个daemon.json配置文件

{
    "bip": "192.168.8.1/24"
}

root@dockerserver# service docker restart
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
root@dockerserver# systemctl daemon-reload   ##重新加载系统配置
root@dockerserver# service docker restart   ########重启docker服务

root@dockerserver# ifconfig docker0   查看docker0网卡信息
docker0   Link encap:EthernetHWaddr 02:42:f7:b3:25:a8
          inet addr:192.168.8.1Bcast:0.0.0.0Mask:255.255.255.0
          inet6 addr: fe80::42:f7ff:feb3:25a8/64 Scope:Link
          UP BROADCAST MULTICASTMTU:1500Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:536 (536.0 B)TX bytes:648 (648.0 B)


页: [1]
查看完整版本: ubuntu下修改docker网卡默认信息