Chinaunix首页 | 论坛 | 博客
  • 博客访问: 544895
  • 博文数量: 114
  • 博客积分: 5611
  • 博客等级: 大校
  • 技术积分: 1027
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 08:55
文章分类

全部博文(114)

文章存档

2011年(29)

2010年(20)

2009年(1)

2008年(11)

2007年(53)

分类: LINUX

2007-04-25 11:14:03

1、下载
linux-2.6.15.6.tar.bz2
patch-2.6.15.6.bz2
iptables-1.3.6.tar.bz2
patch-o-matic-ng-20061024.tar.bz2
2、解压缩
cd /usr/src
tar -jxf linux-2.6.15.6.tar.bz2
tar -jxf iptables-1.3.6.tar.bz2
tar -jxf patch-o-matic-ng-20061024.tar.bz2
 
3、内核先打补丁
cd /usr/src/linux-2.6.15.6
bunzip2 -dv /usr/src/patch-2.6.15.6.bz2 | patch -p0
vi /usr/src/linux-2.6.15.6/include/linux/posix_types.h
   #define __FD_SETSIZE 65536
vi /usr/src/linux-2.6.15.6/include/linux/fs.h
   #define INR_OPEN 65536
   #define NR_FILE  65536
vi /usr/src/linux-2.6.15.6/include/net/tcp.h
   #define TCP_TIMEWAIT_LEN (1*HZ)
   #define TCP_SYNACK_RETRIES  3
 
4、拷贝原来的config
cp /boot/config-2.6.9-42.ELsmp ./.config
注:我的是双cpu的机器,所以是ELsmp
make menuconfig
 
选择 Load an Alternate Configuration File
    选择 .config
保存  退出
 
5、打netfilter补丁
cd /usr/src/path-o-matic-ng-20061024
./runme --download
注:上述命令选择下载ipp2p time等补丁
export KERNEL_DIR=/usr/src/linux-2.6.15.6
export IPTABLES_DIR=/usr/src/iptables-1.3.6
./runme ipp2p
./runme time
./runme connlimit
 
6、配置内核选项
networking
   networking options
      network packet filtering (replaces ipchains)
              IP:Netfilter Configuration
                   把 ipp2p、time、 Connections/IP 选上
 
Security options
    NSA SELinux Support 选项 去除
 
同时保存 退出
 
vi /etc/sysconfig/selinux
    SELINUX=disabled
 
7、开始编译并安装
make all
make modules
make modules_install
make install
 
8、设置grub.conf
    设置default=0的相关项
 
   重新启动计算机
 
9、安装新版本iptable
cd /usr/src/iptables-1.3.6
export KERNEL_DIR=/usr/src/linux-2.6.15.6
export IPTABLES_DIR=/usr/src/iptables-1.3.6
make BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/share/man install
 
10、测试
uname -r 显示内核版本
iptables -V 显示iptables版本
ulimit -a 显示最大打开文件等参数
top 选择1 看多cpu支持情况
 
11、编辑自己的防火墙
 
   
 
阅读(1967) | 评论(0) | 转发(0) |
0

上一篇:ftp自动备份mssql

下一篇:netfiler iptables

给主人留下些什么吧!~~