docker_practice/advanced_network/docker0.md

38 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# docker0
Docker `docker0` `docker0`
Docker `docker0` IP MTU 1500 Bytes宿
* `--bip=CIDR` IP 192.168.1.5/24
* `--mtu=BYTES` Docker mtu
DOCKER_OPTS
Docker Linux 使 `brctl show`
```bash
$ sudo brctl show
bridge name bridge id STP enabled interfaces
docker0 8000.3a1d7362b4ee no veth65f9
vethdda6
```
*`brctl` DebianUbuntu 使 `sudo apt-get install bridge-utils`
Docker IP eth0 使 `docker0` IP
```bash
$ 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
```