docker_practice/advanced_network/docker0.md

38 lines
1.9 KiB
Go
Raw Permalink Normal View History

# docker0
2017-11-29 10:23:42 +08:00
Docker `docker0` `docker0`
2014-09-05 15:50:54 +08:00
Docker `docker0` IP MTU 1500 Bytes宿
2017-11-29 10:23:42 +08:00
* `--bip=CIDR` IP 192.168.1.5/24
* `--mtu=BYTES` Docker mtu
2014-09-18 17:38:20 +08:00
DOCKER_OPTS
2017-11-29 10:23:42 +08:00
Docker Linux 使 `brctl show`
2017-11-29 10:23:42 +08:00
2017-11-22 11:13:23 +08:00
```bash
2014-09-05 15:50:54 +08:00
$ sudo brctl show
bridge name bridge id STP enabled interfaces
docker0 8000.3a1d7362b4ee no veth65f9
vethdda6
2014-09-18 17:38:20 +08:00
```
*`brctl` DebianUbuntu 使 `sudo apt-get install bridge-utils`
2014-09-18 17:38:20 +08:00
Docker IP eth0 使 `docker0` IP
2017-11-29 10:23:42 +08:00
2017-11-22 11:13:23 +08:00
```bash
2014-09-05 15:50:54 +08:00
$ sudo docker run -i -t --rm base /bin/bash
$ ip addr show eth0
24: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 32:6f:e0:35:57:91 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.3/16 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::306f:e0ff:fe35:5791/64 scope link
valid_lft forever preferred_lft forever
$ ip route
default via 172.17.42.1 dev eth0
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3
```