昼からずっとcvsupつながらないのですが、 私のマシンがNATの裏にあるのがいけない?? cvsup2 でも同じでした。 Connecting to cvsup4.jp.freebsd.org Connected to cvsup4.jp.freebsd.org Server software version: SNAP_16_1f Negotiating file attribute support Exchanging collection information Establishing passive-mode data connection Cannot connect to data port: Connection refused Will retry at 18:16:05
最近とてもうざく感じるようになってきた韓国や中国から届く大量のパケットを遮断したいんですが、こんな感じでOKですか? xx0 <= wan側nic block in quick on xx0 proto tcp from aaa.aaa.aaa.aaa/aa to any flags S/S block in quick on xx0 proto tcp from bbb.bbb.bbb.bbb/bb to any flags S/S <略> block in on xx0 proto udp from any to any pass in on xx0 proto udp from any to any port=*** #(udpポートは必要なとこだけ記述)
1 #! /sbin/ipf -Fa -Z -f 1 #pass in quick all 1 #pass out quick all 1 block in log quick from any to any with ipopts 1 block in log quick from any to any with short 1 # 1 # rules on lo0 1 # 1 pass in quick on lo0 all 1 pass out quick on lo0 all 1 # 1 # rules for icmp packets 1 # 1 block in on fxp0 proto icmp all 1 block out on fxp0 proto icmp all 1 pass in on fxp0 proto icmp all 1 pass out on fxp0 proto icmp all 1 # 1 # rules for tcp packets 1 # 1 block in log on fxp0 proto tcp all 1 block out log on fxp0 proto tcp all 1 pass in quick on fxp0 proto tcp all flags A/A 1 #lpr 1 pass in quick on fxp0 proto tcp from any to any port = 515 flags S/SA
59 :
1 #afpd 1 pass in quick on fxp0 proto tcp from any to any port = 548 flags S/SA 1 #windows network 1 pass in quick on fxp0 proto tcp from any to any port 136 >< 140 flags S/SA 1 pass in quick on fxp0 proto tcp from any port 136 >< 140 to any flags S/SA 1 # 1 # rules for udp packets 1 # 1 block in log on fxp0 proto udp all 1 block out log on fxp0 proto udp all 1 #DNS 1 pass in quick on fxp0 proto udp from any port = 53 to any 1 pass out quick on fxp0 proto udp from any to any port = 53 1 #ntp 1 pass in quick on fxp0 proto udp from any port = 123 to any 1 pass out quick on fxp0 proto udp from any to any port = 123 1 #windows network 1 pass in quick on fxp0 proto udp from any to any port 136 >< 140 1 pass in quick on fxp0 proto udp from any port 136 >< 140 to any 1 pass out quick on fxp0 proto udp from any to any port 136 >< 140 1 pass out quick on fxp0 proto udp from any port 136 >< 140 to any
>1 block in on fxp0 proto icmp all >1 block out on fxp0 proto icmp all >1 pass in on fxp0 proto icmp all >1 pass out on fxp0 proto icmp all > ? 行頭の1は無視
> block in on fxp0 proto icmp all > block out on fxp0 proto icmp all > pass in on fxp0 proto icmp all > pass out on fxp0 proto icmp all blockが無意味
65 :
FreeBSD をルータ(ipnat)にして LAN で Winny やろうとしてるんですが うまくいきません。ご指南お願いします… ネット側(fxp0)は PPPoE(フレッツ) 、LAN側(fxp1 192.168.0.1)に Win マシン(192.168.0.2)をつないでます。 ipf.rules は pass in quick proto tcp from any to 192.168.0.2 port = 7743 pass in quick proto tcp from any to 192.168.0.2 port = 7744 pass in quick all pass out quick all ipnat は map pppoe0 192.168.0.1/24 -> 0/32 proxy port ftp ftp/tcp map pppoe0 192.168.0.1/24 -> 0/32 portmap tcp/udp 40000:60000 map pppoe0 192.168.0.1/24 -> 0/32
現在以下のようなルールで快調に動いています。 pass in quick on lo0 from any to any pass in quick on rtls0 from any to any block in log on rtls1 from any to any block in log quick on rtls1 from 127.0.0.0/8 to any block in log quick on rtls1 from 192.168.0.0/24 to any block in log quick on rtls1 from any to any with opt lsrr block in log quick on rtls1 from any to any with opt ssrr block in log quick on rtls1 proto tcp from any to any with short pass in quick on rtls1 proto tcp from any to any port = 20 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port = 21 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port = 22 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port = 25 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port = 80 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port = 113 flags S/SA keep state pass in quick on rtls1 proto tcp from any to any port 30010 >< 30081 flags S/SA keep state pass in quick proto icmp from any to any icmp-type echorep pass in quick proto icmp from any to any icmp-type unreach pass in quick proto icmp from any to any icmp-type squench pass in quick proto icmp from any to any icmp-type echo pass in quick proto icmp from any to any icmp-type timex またipnat.confのてっぺんに↓を追加するとLAN内部から普通のモードでftpできるようになりました。 map rtls1 192.168.0.0/24 -> 0/32 proxy port ftp ftp/tcp コピペばっかでごめんなさいでした。退散。
74 :
keep state するんなら大抵 port 番号を見てると思うけど、 その場合は keep frags も足した方がいいと思うよ。
以上を考慮してルールは以下のようになりました。 pass in quick on rtls0 from any to any pass out quick on rtls0 from any to any pass out quick on rtls1 proto icmp from any to any keep state pass out quick on rtls1 proto udp from any to any keep state pass out quick on rtls1 proto tcp from any to any flags S keep state keep frags block in log on rtls1 from any to any block in log quick on rtls1 from 127.0.0.0/8 to any block in log quick on rtls1 from 192.168.0.0/24 to any block in log quick on rtls1 from any to any with opt lsrr block in log quick on rtls1 from any to any with opt ssrr block in log quick on rtls1 proto tcp from any to any with short pass in quick on rtls1 proto tcp from any to any port = 20 flags S keep state keep frags pass in quick on rtls1 proto tcp from any to any port = 21 flags S keep state keep frags pass in quick on rtls1 proto tcp from any to any port = 22 flags S keep state keep frags pass in quick on rtls1 proto tcp from any to any port = 25 flags S keep state keep frags pass in quick on rtls1 proto tcp from any to any port = 80 flags S keep state keep fragsいてます。 pass in quick on rtls1 proto tcp from any to any port = 113 flags S keep state keep frags pass in quick on rtls1 proto tcp from any to any port 30010 >< 30081 flags S keep state keep frags pass in quick proto icmp from any to any icmp-type echorep pass in quick proto icmp from any to any icmp-type unreach pass in quick proto icmp from any to any icmp-type squench pass in quick proto icmp from any to any icmp-type echo pass in quick proto icmp from any to any icmp-type timex pass in quick on lo0 from any to any pass out quick on lo0 from any to any ...一見快調に動いてるようですが、 あからさまに蛸な部分がありましたらまたご指導お願いします。ではこのへんで 退散。
>>76 head, group 使ってみ block in log on rtls1 from any to any head 100 block in log quick from 127.0.0.0/8 to any group 100 .... block in log proto tcp from any to any head 110 group 100 pass in quick proto tcp from any to any port = 22 flags S keep state keep frags group 110 .... とかな >>75 みたいにまとめてるのを見ると、成長がみられて微笑ましくて、(・∀・)イイ!!
似てる。pass in quick on tun0 proto tcp from any to any port ssh こんなふうに、ipf のルールがそのまま pf でも書けることもある。 でも pf には ipf の head、group は無いし、動作も微妙に違うので上位互換というわけではない。 (groupキーワードはパケットを出したソケットのownerの条件として使われる)