zoukankan      html  css  js  c++  java
  • 给FreeBSD加上了防火墙

      早上去给FreeBSD(4.10)加了个防火墙;
    1.   编译内核:进入 /sys/i386/conf ,cp GENERIC 到 Kernel_IPFW ,在Kernle_IPFW中添加

      options     IPFIREWALL
      options     IPFIREWALL_FORWARD
      options     IPFIREWALL_VERBOSE
      options     IPFIREWALL_VERBOSE_LIMIT=100
      options     IPFIREWALL_DEFAULT_TO_ACCEPT


    2. 然后 config Kernel_IPFW (在/sys/i386/conf 目录中的 LINT 有全部内核选项的说明);按照shell的提示编译并安装新的 Kernel_IPFW。

    3. 在 /etc/rc.conf 添加

      firewall_enable="YES"
      firewall_script="/etc/rc.firewall"
      firewall_type="/etc/ipfw.conf"
      firewall_quiet="YES"
      firewall_logging_enable="NO"


    4. 在 /etc/ipfw.conf 中加入

      add 00001 deny log ip from any to any ipopt rr
      add 00002 deny log ip from any to any ipopt ts
      add 00003 deny log ip from any to any ipopt ssrr
      add 00004 deny log ip from any to any ipopt lsrr
      add 00005 deny tcp from any to any in tcpflags syn,fin
      add 65500 allow tcp from any to me setup limit src-addr 8

      #可以比较有效的防止DDOS


    5. 如果要使用SSH需要编辑 /etc/rc.firewall ,这个文件应该仔细阅读,防火墙规则太多可以在这里编辑。

    6. 可以防止一般的 DDOS,扫描,ICMP攻击等等攻击,若要求更高,可以参考运用sysctl,ipfliter等,修改 /etc/rc.firewall 可以实现更多过滤功能,同样也可以把他变成一台比较专业的防火墙(主要参考编辑 /etc/rc.firewall )。
  • 相关阅读:
    原创frame-relay配置
    iptables详解和练习
    nfs-rpcbind-portmap挂载nfs-network file system
    linux-user-group添加与删除
    cgi-fastcgi-fpm
    lamp介绍
    子签CA以及给别人发CA
    正则表达式
    字符集和字符编码
    C++11新特性
  • 原文地址:https://www.cnblogs.com/fred/p/87555.html
Copyright © 2011-2022 走看看