直接给我说规则也行作者: congli 时间: 2014-07-21 08:42
内网机器想直接用外网IP访问,rdr重定向, 将需要的端口重定向到内网IP上面作者: lsstarboy 时间: 2014-07-21 08:45
不懂pf,但是ipfw我倒知道,可以用楼上的端口映射,也可以用整个IP的映射。作者: tzhxbg 时间: 2014-07-21 15:20
直接在pf.conf 里加入pass in on em0 proto tcp from any to any port 80 rdr-to 10.0.0.6 是不是 em0的10.0.0.6 能被em1 连接的外网访问作者: vity 时间: 2014-07-21 16:40
你的问题写得不清晰,应该整理一下思路先。把电脑都编上编号,把网卡也编上编号,有助于问题解决。
总之,现在 n1 能访问 10.0.0.6 的 80 端口吗?如果可以的话,就在 n1 上添加 rdr-to 规则:
pass in on em0 proto tcp from any to any port 80 rdr-to 10.0.0.6
将 em0 替换为外网的网卡名称,不能写为内网的网卡名称。作者: lsstarboy 时间: 2014-07-22 08:50 回复 8# tzhxbg
w1,w2,w3,g1,n1 的 eth0 都在一个子网中,n1 是网关,这样的话,在 n1 上配置 nat-to 和 rdr-to 即可,给出参考:
pass out on eth1 from eth0:network to any nat-to (eth1)
pass in on eth1 from any to any port 80 rdr-to 10.0.0.6