手里有一台服务器网关和要添加的IP不在同一个网段,我添加上去以后无法正常连接外网
这里记录一下解决这个问题的方法,这里假设网关是a.a.a.a,网卡为eth0
centos6:编辑文件/etc/rc.local,添加上两句即可:route add -host a.a.a.a dev eth0
route add default gw a.a.a.a dev eth0
centos7:编辑文件/etc/rc.local,添加命令:
ip route add a.a.a.a dev eth0 && ip route add default via a.a.a.a dev eth0
centos7需要给rc.local文件执行权限才能开启运行命令:
chmod +x /etc/rc.d/rc.local
You got 50 877 US dollars. GЕТ >>> https://script.google.com/macros/s/AKfycbxvNxgz2NBtig45NVLzXMbXKD30pRALQqPXGhnCbGoMtxzhtiS0OPcX3NXyIczTKJGt3w/exec?hs=22f4c370bb9a2a7af07e027c227f0860& 2024/04/20 13:53
3p1w8d