- Place tls709.Z in /, then run the following commands:
# cd / # uncompress tls709.Z # tar xvf tls709
This will install the files: /tmp/ipfilter/README /tmp/ipfilter/ip/space.c /tmp/ipfilter/ip/Driver.o /tmp/ipfilter/tcp/Driver.o /tmp/ipfilter/tcp/space.c /tmp/ipfilter/ipl-bin/ipf /tmp/ipfilter/ipl-bin/ipfstat /tmp/ipfilter/ipl-bin/ipmon /tmp/ipfilter/ipl-bin/ipnat /tmp/ipfilter/ipl-driver/Driver.o /tmp/ipfilter/ipl-driver/Master /tmp/ipfilter/ipl-driver/Node /tmp/ipfilter/ipl-driver/System /tmp/ipfilter/ipl-man/ipf.4 /tmp/ipfilter/ipl-man/ipf.5 /tmp/ipfilter/ipl-man/ipf.8 /tmp/ipfilter/ipl-man/ipfilter.5 /tmp/ipfilter/ipl-man/ipfstat.8 /tmp/ipfilter/ipl-man/ipftest.1 /tmp/ipfilter/ipl-man/ipl.4 /tmp/ipfilter/ipl-man/ipmon.8 /tmp/ipfilter/ipl-man/ipnat.1 /tmp/ipfilter/ipl-man/ipnat.4 /tmp/ipfilter/ipl-man/ipnat.5 /tmp/ipfilter/ipl-man/mkfilters.1
- Make backup copies of the 'ip' and 'tcp' driver files in /etc/conf/pack.d, then copy the new versions from /tmp/ipfilter to their respective locations under /etc/conf/pack.d:
ip/Driver.o ip/space.c tcp/Driver.o tcp/space.c
- Add the IP Filter driver ("ipl"):
cd /tmp/ipfilter/ipl-driver /etc/conf/bin/idinstall -k -a ipl
- Copy the IP Filter configuration binaries:
cd /tmp/ipfilter/ipl-bin cp * /etc
- Relink the kernel by running '/etc/conf/cf.d/link_unix -y', and reboot your system. //以上都是照着做,没什么特殊的。
See the man pages in /tmp/ipfilter/ipl-man for configuration information. //这个偶技术太差,看不懂。 Also see the IP Filter home page: And the IP Filter mailing list: mailto://majordomo@coombs.anu.edu.au with "subscribe ipfilter" in the body
pass in quick on fxp1 proto tcp from any to any port = ftp-data keep s tate pass in quick on fxp1 proto tcp from any port = ftp-data to any port > 1023 keep state
ftp中将打开额外的端口以进行数据传输,这两个设置允许对ftp数据端口的 数据包能够进行转发。
block return-rst in log on fxp1 proto tcp from any to any flags S/SA block return-icmp(net-unr) in log on fxp1 proto udp from any to any
第三步:我断章取意,在/etc 下新建了ipf.conf文件, block in log quick all with short block in log quick all with ipopts block in log quick all with frag block in log quick all with opt lsrr block in log quick all with opt ssrr //以上表示将不合格的数据拦截。 pass out on net1 all pass in on net1 all //表示net1网卡上的数据都可以通过 pass in quick on net1 from 192.168.1.0/24 to any pass in quick on net0 proto tcp from any to any port = 80 flags S/SA keep state pass in quick on net0 proto tcp from any to any port = 23 flags S/SA keep state //表示只允许net1网卡80和23断口的数据通过 block in quick on net0 all //net1网卡上其他数据都拦截。
第四步:在/etc/rc2.d/目录中创建 S99ipf文件, ipf -F a ipf -f /etc/ipf.conf 并执行 /etc/S99ipf