root@p2ga [ ~ ]# mkdir -p /usr/lib/systemd/system/docker.service.d
root@p2ga [ ~ ]# echo -e "[Service]\nExecStart=\nExecStart=/usr/bin/dockerd --bip=192.168.1.1/24 --fixed-cidr=192.168.1.64/26" > /usr/lib/systemd/system/docker.service.d/10-docker.conf
root@p2ga [ ~ ]# systemctl daemon-reload && systemctl restart docker.service
root@p2ga [ ~ ]# ip a s docker0
21: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:2c:c5:fd:49 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:2cff:fec5:fd49/64 scope link
valid_lft forever preferred_lft forever
root@p2ga [ ~ ]# docker run --rm -ti busybox
/ # ip a s eth0
26: eth0@if27: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue
link/ether 02:42:c0:a8:01:40 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.64/24 scope global eth0
valid_lft forever preferred_lft forever
/ # ping -c2 time.google.com
PING time.google.com (216.239.35.0): 56 data bytes
64 bytes from 216.239.35.0: seq=0 ttl=46 time=60.290 ms
64 bytes from 216.239.35.0: seq=1 ttl=46 time=60.306 ms
--- time.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 60.290/60.298/60.306 ms
/ # exit
root@p2ga [ ~ ]#
Tidak ada komentar:
Posting Komentar