使用Jail和ipfilter结合构建高安全服务器

2009-05-13 01:38:14来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

通过Jail做一个独立的系统,在该系统上面提供一些网络服务,
然后在该FreeBSD系统上通过ipfilter构建一个防火墙,
同时通过ipnat对jail的系统做相应的端口映射!
系统配置参数:
                OS:FreeBSD 4.8 Stable
                IP: fxp0 10.0.1.1 192.168.1.201
                Dns:10.0.0.251
                Defaultrouter:10.0.1.1
        ifconfig显示的信息:
/**
fxp0: flags=8843 mtu 1500
        inet 10.0.1.1 netmask 0xff000000 broadcast 10.255.255.255
        inet 192.168.1.201 netmask 0xffffff00 broadcast 192.168.1.255
        ether 00:00:e2:2d:8b:a5
        media: Ethernet autoselect (100baseTX )
        status: active
lo0: flags=8049 mtu 16384
        inet 127.0.0.1 netmask 0xff000000
**/
实现步骤:
        一:建立jail环境:(安装系统的全部源代码)
                mkdir –p /jail/Jail-A/
                建立一个shell脚本jail.sh,内容如下:
                D=/jail/Jail-A
cd /usr/src
mkdir -p $D
make world DESTDIR=$D
cd etc
make distribution DESTDIR=$D -DNO_MAKEDEV_RUN
cd $D/dev
sh MAKEDEV jail
cd $D
ln -sf dev/null kernel
                编辑/etc/make.conf将一些不需要的东西去掉!(可以根据你具体情况进行设定)
                        CPUTYPE=i686
COPTFLAGS= -O –pipe
INSTALL=install –C
NO_CVS= true    # do not build CVS
NO_BIND=        true    # do not build BIND
NO_FORTRAN=     true    # do not build g77 and related libraries
NO_I4B= true    # do not build isdn4bsd package
NO_LPR= true    # do not build lpr and related programs
NO_MAILWRAPPER=true     # do not build the mailwrapper(8) MTA selector
NO_SENDMAIL=    true    # do not build sendmail and related programs
NO_SHAREDOCS=   true    # do not build the 4.4BSD legacy docs
NO_X=           true    # do not compile in XWindows support (e.g. doscmd)
NOGAMES=        true    # do not build games (games/ subdir)
NOINFO= true    # do not make or install info files
NOLIBC_R=       true    # do not build libc_r (re-entrant version of libc)

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:BSD系统调用规范

下一篇:用IPFW实现BSD防火墙