Hi! I’m clsung

Hi! I’m clsung

clsung’s blog site, or you can call me AlanSung

Hi! I’m clsung RSS Feed
 
 
 
 

[jail] pf memo

pf 是真的不錯用,主要原因為它在三種 pf-like 軟體內,字母最少 :D

  • 讓 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)

才不會發生連不出去的狀況。

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • funp
  • Haohao
  • Hemidemi
  • Live
  • MisterWong
  • TwitThis
  • udn

Leave a Reply

噗浪:

分類

Flickr

    clsung. Get yours at bighugelabs.com/flickr

Blogroll

    馬的警總回來了
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Taiwan
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Taiwan