我正在尝试Cisco VPN client
在 Docker 中运行控制台。我这样启动容器:
docker run -it -v /srv/vpn/keys/:/root/keys/ --network=host --cap-add=NET_ADMIN --device=/dev/net/tun -v /dev/net/tun:/dev/net/tun vpn-vpnc-client_img
然后vpnc
在 Docker 容器中运行客户端
vpnc-connect /root/keys/vpnc.conf --local-port 0
它产生以下输出:
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
Cannot open "/proc/sys/net/ipv4/route/flush": Read-only file system
VPNC started in background (pid: 257)...
vpnc
连接并创建正确的路由,因此 VPN 似乎可以工作。我担心的是警告信息。根据文档,对于/proc/sys/net/ipv4/route/flush
写入此文件会导致路由缓存刷新。
我不明白这个说法。路由缓存没有被刷新是否很重要?
另外,据我了解,我可以发出
echo 1 > /proc/sys/net/ipv4/route/flush
容器启动后手动。但我monit
在 docker 容器内使用重新启动vpnc
if 连接丢失。我可以/proc/sys/net/ipv4/route/flush
以某种方式从容器内的主机绑定挂载,并发出命令从容器内的监控脚本刷新路由缓存吗?