osroot

通过外网IP访问内网

外网服务器:外网IP1,内网IP192.168.2.156

内网服务器:内网IP192.168.2.206

 

通过访问外网服务器8083端口,转发到内网服务器的8083端口。

 

在外网服务器设置映射规则:

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p tcp --dport 8083 -j DNAT --to-destination 192.168.2.206:8083
iptables -t nat -A POSTROUTING -d 192.168.2.206 -p tcp --dport 8083 -j SNAT --to 192.168.2.156

分类:

技术点:

相关文章:

  • 2021-12-30
  • 2021-11-22
  • 2022-12-23
  • 2021-12-03
  • 2022-03-09
  • 2021-09-28
  • 2021-11-30
  • 2021-09-24
猜你喜欢
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
相关资源
相似解决方案