學術及資源的交流園地 ^_^

shorewall - rules, params

 

params

用來定義在 configure file 可用到的變數

 

/etc/shorewall/params:

NET_IF=eth0

ADMIN_IP= 192.168.123.10, 192.168.123.200

 


 

rules

 

  • requests and responses are automatically allowed using connection tracking.
  • All rules are terminating except LOG and COUNT rules.

 

COMMENT Allow SSH from admin
SSH(ACCEPT)    net:$ADMIN_IP      $FW
COMMENT

Shorewall show

/* Allow SSH from home */

 

以上的 rule 相當於:

shorewall - Macros 與 Action

 

所有可用的 macro 存放在以下 Folder

/usr/share/shorewall/macro.*

 

#ACTION   SOURCE   DEST   PROTO    DEST PORT(S)   SOURCE
#                                                 PORT(S)
SMB(ACCEPT)  $FW      loc
SMB(ACCEPT)  loc      $FW

 


 

常用的 macro

 

macro 可以理解成所有人都可做什麼

  • macro.SSH
  • macro.Web
  • macro.Mail
  • macro.Ping
  • macro.SMB
  • macro.Munin
  • macro.FTP
  • macro.DNS

 

macro.Ping 的內容

shorewall - accounting

 

 

 

#ACTION CHAIN   SOURCE  DESTINATION     PROTOCOL        DEST            SOURCE
#                                                       PORT            PORT
DONE    -       eth0    eth1            tcp             80
DONE    -       eth1    eth0            tcp             -               80

 

/etc/shorewall/accounting

shorewall - policy

 

 

 

#SOURCE DEST    POLICY          LOG     LIMIT:          CONNLIMIT:
#                               LEVEL   BURST           MASK

wan     vps     ACCEPT
vps     wan     ACCEPT
fw      all     ACCEPT
all     all     REJECT

 

就 policy 在 iptable 會建立

Chain fw2vps (1 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

Chain fw2wan (1 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

 

 

 

 

 

POLICY:

RSS feed