參考文件:
- Init
- $ sudo mkdir /Library/StartupItems/Firewall
- $ sudo touch /Library/StartupItems/Firewall/Firewall
- $ sudo chmod ug+x /Library/StartupItems/Firewall/Firewall
- $ sudo chmod o-rwx /Library/StartupItems/Firewall/Firewall
- /Library/StartupItems/Firewall/Firewall
- !/bin/sh
########## file @ /Library/StartupItems/Firewall/Firewall
# http://www.freebsd.org/doc/en/books/handbook/firewalls-ipfw.html
# http://www.ibiblio.org/macsupport/ipfw/
ipfw=`which ipfw`
$ipfw -q -f flush
cmd="$ipfw -q add "
$cmd 00500 check-state
$cmd 07999 allow all from x.y.My.PC1 to any
$cmd 07999 allow all from x.y.My.PC2 to any
$cmd 07999 allow all from x.y.My.PC3 to any
$cmd 08999 deny all from x.y.0.0/16 to any
$cmd 09999 allow all from any to any
- !/bin/sh
- /Library/StartupItems/Firewall/StartupParameters.plist
- {
Description = "Firewall";
Provides = ("Firewall");
Requires = ("Network");
OrderPreference = "None";
Messages =
{
start = "Starting NAT/Firewall";
stop = "Stopping NAT/Firewall";
};
}
- {
其中 x.y.My.PC1 要留意設定,有時要記的加上常用的機器列表,別忘了加公司的 DNS,這樣才能你的機器才能連過去。
沒有留言:
張貼留言