免费注册 查看新帖 |

Chinaunix

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

[FreeBSD] fb54,fb60用pf做nat老是不定期自动重启,不知各位谁能解决 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-01 09:29 |只看该作者 |倒序浏览
一台双电源旧式服务器,不运行pf做nat可以长时间运行,但一旦作为网关就不定期自动重启.
pf规则如下:
TRANSLATION RULES:
nat on dc0 all -> (dc0) round-robin
rdr pass on dc0 inet proto tcp from any to X.X.X.X port = 49999 -> 172.16.16.4 port 80
rdr pass on dc0 inet proto tcp from any to any port = 49998 -> 172.16.16.58 port 3389

FILTER RULES:
scrub in all fragment reassemble
block drop in quick on fxp0 inet proto tcp from <RES_ALL> to any port = 1863
block drop in quick on fxp0 inet proto tcp from <RES_ALL> to any port 444 >< 3127
block drop in quick on fxp0 inet proto tcp from <RES_ALL> to any port > 3129
block drop in quick on fxp0 inet proto udp from any to any port = loc-srv
block drop in quick on fxp0 inet proto udp from any to any port = profile
block drop in quick on fxp0 inet proto udp from any to any port = netbios-ns
block drop in quick on fxp0 inet proto udp from any to any port = netbios-dgm
block drop in quick on fxp0 inet proto udp from any to any port = netbios-ssn
block drop in quick on fxp0 inet proto udp from any to any port = microsoft-ds
block drop in quick on fxp0 inet proto udp from any to any port 52 <> 8001
pass quick on lo0 all
pass in quick on dc0 inet proto tcp from any to X.X.X.X port 45000 >< 65535 keep state queue
oSsh
block drop in quick on dc0 inet from <PRIV_NETS> to X.X.X.X
block drop all
pass out on dc0 all keep state queue oOther
pass out on fxp0 all keep state
pass in on fxp0 inet all keep state queue other
pass in on fxp0 inet proto tcp from any to any port = ssh keep state
pass in on fxp0 inet proto tcp from any to any port = 50000 keep state
pass out on dc0 proto tcp from (dc0) to any port = ssh keep state queue oSsh
pass out on dc0 proto tcp from (dc0) to any port = 50000 keep state queue oSsh
pass out on dc0 proto udp from (dc0) to any port = domain keep state queue oQuick
pass out on dc0 proto tcp from (dc0) to any port = domain keep state queue oQuick
pass out on dc0 proto icmp from (dc0) to any keep state queue oQuick
pass out on dc0 proto tcp from (dc0) to any port = smtp keep state queue oQuick
pass out on dc0 proto tcp from (dc0) to any port = pop3 keep state queue oQuick
pass out on dc0 proto tcp from (dc0) to any port = imap keep state queue oQuick
pass out on dc0 proto tcp from (dc0) to any port = http keep state queue web
pass out on dc0 proto tcp from (dc0) to any port = https keep state queue web
pass out on dc0 proto tcp from (dc0) to any port = 50001 keep state queue web
pass in on fxp0 inet proto tcp from <RES_NET> to any port = ssh keep state queue ssh
pass in on fxp0 inet proto tcp from <RES_NET> to any port = 50000 keep state queue ssh
pass in on fxp0 inet proto udp from any to any port = domain keep state queue mQuick
pass in on fxp0 inet proto tcp from any to any port = domain keep state queue mQuick
pass in on fxp0 inet proto icmp all keep state queue mQuick
pass in on fxp0 inet proto tcp from any to any port = smtp keep state queue mQuick
pass in on fxp0 inet proto tcp from any to any port = pop3 keep state queue mQuick
pass in on fxp0 inet proto tcp from any to any port = imap keep state queue mQuick
pass in on fxp0 inet proto tcp from <RES_NET> to any port = http keep state queue eQuick
pass in on fxp0 inet proto tcp from <RES_NET> to any port = https keep state queue eQuick
pass in on fxp0 inet proto tcp from <RES_NET> to any port = 50001 keep state queue eQuick
pass in on fxp0 inet proto tcp from <RES_ALL> to any port = http keep state queue lQuick
pass in on fxp0 inet proto tcp from <RES_ALL> to any port = https keep state queue lQuick
pass in on fxp0 inet proto tcp from <RES_ALL> to any port = 50001 keep state queue lQuick

ALTQ:
queue root_fxp0 bandwidth 4Mb priority 0 cbq( wrr root ) {ssh, mQuick, eQuick, lQuick, other}
queue ssh bandwidth 400Kb priority 7 cbq( red ecn borrow )
queue mQuick bandwidth 400Kb priority 6 cbq( red ecn borrow )
queue eQuick bandwidth 1.60Mb priority 5 cbq( red ecn borrow )
queue lQuick bandwidth 1.20Mb priority 4 cbq( red ecn borrow )
queue other bandwidth 400Kb priority 2 cbq( red ecn borrow default )
queue root_dc0 bandwidth 500Kb priority 0 cbq( wrr root ) {oSsh, oQuick, web, oOther}
queue oSsh bandwidth 50Kb priority 7 cbq( red ecn borrow )
queue oQuick bandwidth 50Kb priority 6 cbq( red ecn borrow )
queue web bandwidth 250Kb priority 5 cbq( red ecn borrow )
queue oOther bandwidth 150Kb priority 2 cbq( red ecn borrow default )



sysctl.conf:
kern.coredump=0
net.inet.tcp.rfc1323=1
net.inet.tcp.rfc1644=1
net.inet.tcp.rfc3042=1
net.inet.tcp.rfc3390=1
net.inet.ip.forwarding=1
kern.ipc.maxsockbuf=8388608
#kern.ipc.somaxconn=32768
#kern.ipc.shmall=32768
kern.maxfiles=524688
kern.maxfilesperproc=262344
net.inet.tcp.delayed_ack=0
net.inet.tcp.sendspace=524688
net.inet.tcp.recvspace=524688
net.inet.udp.recvspace=262344
net.inet.udp.maxdgram=114688
net.local.stream.recvspace=524688
net.local.stream.sendspace=524688
net.inet.icmp.bmcastecho=0
net.inet.icmp.maskrepl=0
net.inet.icmp.icmplim=100
net.inet.tcp.always_keepalive=0
net.inet.ip.intr_queue_maxlen=2000
net.inet.tcp.inflight.enable=1
kern.ipc.nmbclusters=262246


loader.conf如下:
kern.ipc.maxsockets="262344"
net.inet.tcp.tcbhashsize="10240"

squid没有开
网卡一张是intel(fxp0)的,另一张是dc0,

pftop.jpg (16.45 KB, 下载次数: 20)

pftop.jpg

论坛徽章:
0
2 [报告]
发表于 2006-03-01 12:04 |只看该作者
这是高峰时的pftop值

1.jpg (16.95 KB, 下载次数: 31)

1.jpg

论坛徽章:
0
3 [报告]
发表于 2006-03-02 17:34 |只看该作者
自已来顶一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP