0
点赞
收藏
分享

微信扫一扫

iptables 跳板机转发策略

1、中转机执行策略。

iptables -t nat -I PREROUTING -s 10.*.*.125/30(对端过来地址出口) -p tcp -m tcp --dport 28070 -j DNAT --to-destination 10.15.2.10:28070

对端过来的流量转到到内网另一台机器

iptables -t nat -I PREROUTING -s 10.15.2.10 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.*.*.65(我们访问对端地址):80

我方过去的流量通过跳板机的80端口出去

iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE

地址伪装指定定ens192网卡

2、内网服务器15.10执行策略。

iptables -t nat -I OUTPUT -p tcp -d 10.*.*.65 --dport 80 -j DNAT --to-destination 10.12.2.26:80

出口地址转换

3、开启iptables转发

vi /etc/sysctl.conf

net.ipv4.ip_forward=1

sysctl -p

举报

相关推荐

0 条评论