首先:登录我们用于转发的机器,查看firewall防火墙是否开启。
firewall-cmd –state
第二:开启防火墙伪装,开启后才能转发端口:
firewall-cmd –add-masquerade –permanent
第三:添加转发规则:
firewall-cmd –add-forward-port=port=3389:proto=tcp:toport=3389:toaddr=WIN主机IP –permanent
第四:重载防火墙配置,让它生效
firewall-cmd –reload
到这里就完成了
查看反代端口转发情况:
firewall-cmd –list-all
如果需要移除端口转发:
使用以下命令:
firewall-cmd –remove-forward-port=port=3389:proto=tcp:toport=3389:toaddr=WIN主机IP –permanent
firewall-cmd –remove-masquerade –permanent
firewall-cmd –reload
firewall-cmd –remove-masquerade –permanent
firewall-cmd –reload
发表回复