docker_53# vim /etc/sysctl.conf net.ipv4.ip_forward = 1 docker_53# sysctl -p docker error: "Read-only file system" setting key "net.ipv4.ip_forward"
bash-3.2# docker run -itd --privileged -h docker_54 --name docker_54 centos:latest bash bash-3.2# docker exec -it docker_54 bash docker_54# vim /etc/sysctl.conf net.ipv4.ip_forward = 1 docker_54# sysctl -p net.ipv4.ip_forward = 1 net.ipv4.tcp_syncookies = 1
建立容器時, 加上--privileged便可docker