配置iptables
sudo iptables -t nat -A POSTROUTING -s "192.168.0.1/24" -o eth0 -j MASQUERADE
打开转发功能
取消/etc/resolv.conf里面net.ipv4.ip_forward = 1的注释 使命令生效: sudo sysctl -p
关键:关闭Ubuntu 16.04 的防火墙
sudo ufw disable
参考资料
https://help.ubuntu.com/lts/serverguide/firewall.html
转载请注明原文地址: https://ju.6miu.com/read-38841.html