免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 5018 | 回复: 25
打印 上一主题 下一主题

[OpenBSD] OpenBSD3.9 + pf 无法正常连上FTP? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-19 14:37 |只看该作者 |倒序浏览
OpenBSD3.9 + pf 当网关,外网卡绑多IP无法正常连上FTP,该如何解决。

论坛徽章:
0
2 [报告]
发表于 2006-10-19 14:40 |只看该作者
pf是怎么配置的?

论坛徽章:
0
3 [报告]
发表于 2006-10-19 14:58 |只看该作者
#       $OpenBSD: pf.conf,v 1.32 2006/05/05 16:21:58 Kadi Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.
#============================
# Macros
#============================

ext_if = "sis0"         # 60.130.130.199 ; 60.130.130.200 ; 60.130.130.201     ADSL
dmz_if = "vr0"          # 192.168.2.14/28       1 -> 14
int_if = "vr1"          # 192.168.1.30/27       1 -> 30

int_tcp_services = "{ 22, 8000 }"
server_host = "192.168.2.1"
icmp_types = "echoreq"

priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"

www_svr = "192.168.2.1"

#============================
# Options
#============================

set block-policy return
set loginterface $ext_if

#============================
# Scrub
#============================

scrub in all

#============================
# Net And DRD
#============================

nat on $ext_if from { $int_if:network, $dmz_if:network } to any -> $ext_if

nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"

rdr pass on { $int_if, $dmz_if } proto tcp to port ftp -> 127.0.0.1 port 8021

rdr on $ext_if proto tcp from any to $ext_if port 80 -> $www_svr port 80

anchor "ftp-proxy/*"

#============================
# Filter Rules
#============================

block all

pass quick on lo0 all

block drop in quick on $ext_if from $priv_nets to any
block drop out quick on $ext_if from any to $priv_nets

pass in on $ext_if proto { tcp, udp } from any to $ext_if port 53 keep state

pass in on $int_if inet proto tcp from any to $int_if \
        port $int_tcp_services flags S/SA keep state

pass in on $ext_if proto tcp from any to $www_svr port 80 \
        flags S/SA synproxy state

pass in on { $int_if, $dmz_if } inet proto icmp all icmp-type $icmp_types keep state

pass in on { $int_if, $dmz_if } from { $int_if:network, $dmz_if:network } to any keep state
pass out on { $int_if, $dmz_if } from any to { $int_if:network, $dmz_if:network } keep state

pass out on { $ext_if, $dmz_if } proto tcp all modulate state flags S/SA
pass out on { $ext_if, $dmz_if } proto { udp, icmp } all keep state

#============================

论坛徽章:
0
4 [报告]
发表于 2006-10-19 15:21 |只看该作者
我好像没有看到pass ftp的规则呀,其他朋友,你们看到了吗??

我的单机是这么做得

pass in on $ex_if proto tcp from any to any port 21 keep state
pass in on $ex_if proto tcp from any to any port > 49151 keep state

如果是nat

我是这么做得:
rdr on $ex_if proto tcp from any to any port ftp -> $ftp_server
pass in on $ex_if proto tcp from any to $ftp_server port ftp flags S/SA

[ 本帖最后由 Ericzhao82 于 2006-10-19 15:30 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-10-19 15:33 |只看该作者
谢谢回复

我的意思是连外部ftp server,不是连进。

[ 本帖最后由 kadi 于 2006-10-19 15:35 编辑 ]

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
6 [报告]
发表于 2006-10-19 16:02 |只看该作者
lz好象用authpf来验证客户端.
那客户是直接用putty等ssh工具还是用其他方式,如web?

论坛徽章:
0
7 [报告]
发表于 2006-10-19 16:23 |只看该作者
我是用WS_FTP工具或是firefox

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
8 [报告]
发表于 2006-10-19 16:24 |只看该作者
原帖由 kadi 于 2006-10-19 16:23 发表
我是用WS_FTP工具或是firefox

晕,我不是指你用什么FTP工具.

论坛徽章:
0
9 [报告]
发表于 2006-10-19 16:33 |只看该作者
不好意思,不懂你的意思

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
10 [报告]
发表于 2006-10-19 16:38 |只看该作者
原帖由 kadi 于 2006-10-19 16:33 发表
不好意思,不懂你的意思

呵~没关系
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP