般通过ISA Server所设置的防火墙架构分为Edge Firewall(边缘防火墙)、3-Leg Perimeter Firewall(3向外围防火墙)、Back-to-Back Perimeter Firewall(背对背外围防火墙)与单一网络适配器(网卡)四种等。
DNS view
内核编译:
2.6---->3.0
单内核:模块化(文件系统,驱动,安全)
微内核:
编译内核:
配置 .config (/proc/cpuinfo,lsusb,lspci,hal-device)
make menuconfig
make gconfig
make kconfig
make config
make oldconfig
编译
make
只编译部分源码
make SUBDIR=arch/
make drivers/net/pcnet32.ko
make dir
转存编译结果
make o=/path/to/somdir
安装内核模块
make modules_install
安装内核
make install
make clean 清除以前的编译
make mrproper
/boot
busybox kernel = linux
ulibc
Kernel Patch
# tar zxvf linux-2.6.28.10.tar.gz -C /usr/src
# tar zxvf netfilter-layer7-v2.22.tar.gz -C /usr/src
# cd /usr/src
# ln –s linux-2.6.28.10 linux
# cd /usr/src/linux/
# patch -p1 < ../netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch
# cp /boot/config-2.6.18-164.el5 /usr/src/linux/.config
# make menuconfig
Networking support → Networking Options →Network packet filtering framework →Core Netfilter Configuration
<M> Netfilter connection tracking support
<M> “layer7” match support
<M> “string” match support
<M> “time” match support
<M> “iprange” match support
<M> “connlimit” match support
<M> “state” match support
<M> “conntrack” connection match support
<M> “mac” address match support
<M> "multiport" Multiple port match support
Networking support → Networking Options →Network packet filtering framework → IP: Netfilter Configuration
<M> IPv4 connection tracking support (required for NAT)
<M> Full NAT
<M> MASQUERADE target support
<M> NETMAP target support
<M> REDIRECT target support
# make
# make modules_install
# make install
Compiles iptables :
# cp /etc/init.d/iptables ~/iptables
# cp /etc/sysconfig/iptables-config ~/
# rpm -e iptables-ipv6 iptables iptstate --nodeps
# tar jxvf iptables-1.4.6.tar.bz2 –C /usr/src
# cd /usr/src/iptables-1.4.6
# cp ../netfilter-layer7-v2.22/iptables-1.4.3forward-for-kernel-2.6.20forward/libxt_layer7.* ./extensions/
# ./configure --prefix=/usr --with-ksource=/usr/src/linux
# make
# make install
代码语言:javascript复制
# tar zxvf l7-protocols-2009-05-28.tar.gz
# cd l7-protocols-2009-05-28
# make install
# mv ~/iptables /etc/rc.d/init.d/
# service iptables start
l7-filter uses the standard iptables extension syntax
# iptables [specify table & chain] -m layer7 --l7proto [protocol name] -j [action]
linux-2.6.18
iptables-1.4.6.tar.bz2
l7-protocols-2009-05-28.tar.gz
netfilter-layer7-v2.22.tar.bz2
tar xvf linux-2.6.28.110.tzr.gz -C /usr/src
tar xvf netfilter-layer7-v2.22 -C /usr/src
cd /usr/src
ln linux-2.6.28.10 linux
cd linux
patch -p1 < ../netfilter-layer7-v2.22 /kernel-2.6.25-2.6.28-layer7-2.22.patch
cp /boot/config-2.6.18-308.el5 .config
yum grouplist
make menuconfig
Networking support → Networking Options →Network packet filtering framework →Core Netfilter Configuration
make
make install_modules
make install
vim /etc/grub.conf
default=0
reboot
uname -r
ipt---->xt_
编译iptables
cp /etc/init.d/iptbales ~/
cp /etc/sysconfig/iptables-config ~/
cp /etc/sysconfig/iptables ~/iptables.rules
servcie iptables stop
chkconfig iptables off
rpm -e iptables-ipv6 iptables iptables --nedeps
cd /usr/src
tar xvf iptables-1.4.6.tar.gz
cd iptables
ls
cp ../netfilter-layer7-v2/iptables-1.1.4.3forward-for-kernel-2.6.20forward/libxt_layer7.* ./extensions/
./configure --prefix=/usr --with-ksource=/usr/src/linux
make
mkae install
which iptables
cp ~
vim iptables
/usr/sbin/
cp iptables /etc/init.d/
chkconfig --add iptables
chkconfig iptables on
chkconfig --list iptables
cp iptables-config /etc/sysconfig/iptables
vim iptables.rules
cp iptables.rules /etc/sysconfig/iptables
service iptables start
lsmod
cd /usr/src
tar I7-protocols-2009-05-28.tar.gz
cd I7-protocols-2009-05-28
make install
service iptables restart
l7-filter使用语法:
代码语言:javascript复制
iptables [specify tables & chain] -m layer7 --l7proto [protocol name] -j [action]
ls /etc/I7-protocols/protocols/
172.16.100.7
192.168.10.6
iptables -t nat -A POSTRUTING -s 192.168.10.0/24 -j SNAT --to-source 172.16.100.7
iptables -t filter -A FORWARD -s 192.168.10.0/24 -m layer7 --l7proto qq -j DROP
qq:udp
iptables
-m time
--datestart --datestop
--timestart --timestop
iptables -A FORWARD -s 192.168.10.0/24 -m tme --timestart 08:10:00 --timestop 12:00:00 -j DROP
iptables -A FORWARD -s 192.168.10.0/24 -m time --tmiestart 14:30:00 --timestop 18:20:00 -j DROP
service iptables save
iptables-save >/etc/sysconfig/iptables.tus
iptables-restore < /etc/sysconfig/iptables.tus