https://blog.youkuaiyun.com/petpig0312/article/details/80190623 vim /etc/network/interfaces ifdonw enp1s0 ifup enp1s0 ifconfig ip_forward : echo 1 > /proc/sys/net/ipv4/ip_forward # iptables -F # iptables -P INPUT ACCEPT # iptables -P FORWARD ACCEPT # iptables -t nat -A POSTROUTING -o wlp2s0 -j MASQUERADE (wlp2s0为A主机接外网的网卡