flyoung
1.启用网关服务器路由转发功能
[root@localhost~]# vi /etc/sysctl.conf
net.ipv4.ip_forward=1

[root@localhost~]# sysctl -p

2.为局域网访问Internet 的数据包采用SNAT策略,将源地址更改为服务器的公网IP地址
[root@localhost~]# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 公网IP
(eth0 这个我不知道你配得哪个口 自己改)

未测试。。。

分类:

技术点:

相关文章:

  • 2021-12-06
  • 2021-07-06
  • 2021-11-08
  • 2021-12-08
  • 2021-11-30
  • 2021-06-07
猜你喜欢
  • 2021-11-29
  • 2021-11-29
  • 2021-12-03
  • 2021-09-19
  • 2021-12-15
相关资源
相似解决方案