[jail] pf memo
pf 是真的不錯用,主要原因為它在三種 pf-like 軟體內,字母最少
- 讓 jail 裡的人可以連出去,要用 pf nat
nat on $ext_if from $internal_net to any -> ($ext_if)
- 讓外面的人可以連進來,要用 pf rdr
rdr pass on $ext_if proto tcp from any to $external_addr/32 port 21 -> 127.0.1.2 port 21
大概就這樣先記一下,另外也可以參考用 pflog 記錄一下,如果要用 pflog ,記得在 /etc/pf.conf 加一行
set loginterface $ext_if
就可以了。
Update 2006/4/24: 如果是用同一張網路卡對內(jail)對外,那麼最好將 nat 改成:
-
nat on $ext_if from !( $ext_if) to any -> ($ext_if)
才不會發生連不出去的狀況。














