NetBSD 1.6.2から2.0にしたらなにやらipfilter周りの挙動が訳わからなく。。 ルールにflags S/SAとか設定してると通らないし,, reloadするとioctl(add/insert rule): No such processとか怒られるし。 でもちゃんとフィルタはされてたり。
ルールは # pfctl -sr scrub in on ng1 all fragment reassemble block return in quick on ng1 from <bann_ip> to any block return in quick on ng1 proto tcp from any to any port = loc-srv block return in quick on ng1 proto tcp from any to any port = netbios-ns block return in quick on ng1 proto tcp from any to any port = netbios-ssn block return in quick on ng1 proto tcp from any to any port = microsoft-ds block return in quick on ng1 proto udp from any to any port = loc-srv block return in quick on ng1 proto udp from any to any port = netbios-ns block return in quick on ng1 proto udp from any to any port = netbios-ssn block return in quick on ng1 proto udp from any to any port = microsoft-ds pass in quick on lo0 all pass in quick on dc1 all pass in all pass out all block return in log on ng1 all pass in log on ng1 inet proto udp from (ng1) to 224.0.0.0/4 pass in on ng1 proto tcp from <office_ip> to (ng1) port = ssh keep state pass out on ng1 proto tcp all keep state pass out on ng1 proto udp all keep state pass out on ng1 proto icmp all keep state block return out on ng1 inet proto udp from any to 224.0.0.0/4 port = 1900 pass in on ng1 inet proto tcp from any to (ng1) user = 62 keep state # pfctl -sn nat on ng1 inet from 192.168.0.0/24 to any -> (ng1) round-robin rdr on dc1 inet proto tcp from any to ! 192.168.0.0/24 port = ftp -> 127.0.0.1 port 8021 と、特に怪しくないはずだけど。pfってまだ駄目?
例えばhttpを見に行きたい場合、 pass in quick proto tcp all flags A/A group 100 pass out quick proto tcp all flags A/A group 150 pass out quick proto tcp from any to any port = 80 flags S/SA group 100 みたいな感じで許可するのと、 pass out quick proto tcp from any to any port = 80 flags S keep state group 100 みたいな感じではどっちが良いでしょうか。
Host name resolution and interface to address translation are done at ruleset load-time. When the address of an interface (or host name) changes (under DHCP or PPP, for instance), the ruleset must be reloaded for the change to be reflected in the kernel. Surrounding the interface name in parentheses changes this behaviour. When the interface name is surrounded by parentheses, the rule is automatically updated whenever the interface changes its address. The ruleset does not need to be reloaded. This is especially useful with nat.
IPアドレス 219.104.169.90 ホスト名 ktsk130090.catv.ppp.infoweb.ne.jp IPアドレス 割当国 ※ 日本 (JP) 都道府県 東京都 市外局番 03 接続回線 CATV Domain Information: [ドメイン情報] a. [ドメイン名] INFOWEB.NE.JP b. [ねっとわーくさーびすめい] c. [ネットワークサービス名] InfoWeb d. [Network Service Name] InfoWeb k. [組織種別] ネットワークサービス l. [Organization Type] Network Service m. [登録担当者] KH071JP n. [技術連絡担当者] KN6902JP p. [ネームサーバ] ns.web.ad.jp p. [ネームサーバ] ns2.web.ad.jp p. [ネームサーバ] ns3.web.ad.jp [状態] Connected (2006/01/31) [登録年月日] 1997/01/22 [接続年月日] 1997/01/31 [最終更新] 2005/02/01 01:05:35 (JST)
PF(Packet Filter)でTCP SYN flood攻撃防御のため pass in on $ext_if proto tcp from any to $ext_if port $tcp_sv flags S/SA keep state を、 pass in on $ext_if proto tcp from any to $ext_if port $tcp_sv flags S/SA synproxy state と書いたら弾かれてしまうんですが
# TCP SYN プロキシ synproxy state は、その動作原理から keep state および modulate state の機能も含んでいます。