Chinaunix首页 | 论坛 | 博客
  • 博客访问: 714791
  • 博文数量: 116
  • 博客积分: 7046
  • 博客等级: 少将
  • 技术积分: 1160
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-14 13:47
个人简介

学无止境

文章分类

全部博文(116)

文章存档

2019年(1)

2011年(1)

2009年(6)

2008年(25)

2007年(44)

2006年(39)

我的朋友

分类: LINUX

2006-06-21 16:36:00

我的系统centos3.7,因为是单张盘安装的,所以里面有好多包都没装,在安装时参考了白金的iptables添加模块howto,还在cu上找了资料。下面是操作步骤和问题解决:
先yum install kernel-source安装内核原码,我的内核版本是2.4.21-40.EL。
在是iptables-1[1].3.5-20060521.tar.bz2。
在patch-o-matic-ng-20060521[1].tar.bz2。
#mv iptables-1[1].3.5-20060521.tar.bz2 /usr/src
#mv patch-o-matic-ng-20060521[1].tar.bz2 /usr/src
#tar xjvf iptables-1[1].3.5-20060521.tar.bz2
#tar xjvf patch-o-matic-ng-20060521[1].tar.bz2
#cd /usr/src/linux-2.4.21-40.EL
#make mrproper
#make menuconfig
在这步时报错了
[root@localhost linux-2.4.21-40.EL]# make menuconfig
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
make -C scripts/lxdialog all
make[1]: Entering directory `/usr/src/linux-2.4.21-40.EL/scripts/lxdialog'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DLOCALE  -DCURSES_LOC="" -c -o checklist.o checklist.c
In file included from checklist.c:24:
dialog.h:29:20: curses.h: ûÓÐÄǸöÎļþ»òĿ¼
In file included from checklist.c:24:
dialog.h:127: syntax error before "use_colors"
dialog.h:127: warning: type defaults to `int' in declaration of `use_colors'
dialog.h:127: warning: data definition has no type or storage class
dialog.h:128: syntax error before "use_shadow"
dialog.h:128: warning: type defaults to `int' in declaration of `use_shadow'
dialog.h:128: warning: data definition has no type or storage class
dialog.h:130: syntax error before "attributes"
dialog.h:130: warning: type defaults to `int' in declaration of `attributes'
dialog.h:130: warning: data definition has no type or storage class
dialog.h:143: syntax error before '*' token
dialog.h:143: warning: function declaration isn't a prototype
dialog.h:146: syntax error before '*' token
dialog.h:146: warning: function declaration isn't a prototype
dialog.h:147: syntax error before '*' token
dialog.h:147: warning: function declaration isn't a prototype
dialog.h:148: syntax error before '*' token
dialog.h:149: warning: function declaration isn't a prototype
dialog.h:150: syntax error before '*' token
dialog.h:150: warning: function declaration isn't a prototype
checklist.c:32: syntax error before '*' token
checklist.c:34: warning: function declaration isn't a prototype
checklist.c: In function `print_item':
checklist.c:38: warning: implicit declaration of function `wattrset'
checklist.c:38: `win' undeclared (first use in this function)
checklist.c:38: (Each undeclared identifier is reported only once
checklist.c:38: for each function it appears in.)
checklist.c:39: warning: implicit declaration of function `wmove'
checklist.c:39: `choice' undeclared (first use in this function)
checklist.c:41: warning: implicit declaration of function `waddch'
checklist.c:44: `selected' undeclared (first use in this function)
checklist.c:46: warning: implicit declaration of function `wprintw'
checklist.c:46: `status' undeclared (first use in this function)
checklist.c:51: warning: implicit declaration of function `mvwaddch'
checklist.c:51: `item' undeclared (first use in this function)
checklist.c:53: warning: implicit declaration of function `waddstr'
checklist.c:56: warning: implicit declaration of function `wrefresh'
checklist.c: At top level:
checklist.c:64: syntax error before '*' token
checklist.c:66: warning: function declaration isn't a prototype
checklist.c: In function `print_arrows':
checklist.c:67: `win' undeclared (first use in this function)
checklist.c:67: `y' undeclared (first use in this function)
checklist.c:67: `x' undeclared (first use in this function)
checklist.c:69: `scroll' undeclared (first use in this function)
checklist.c:82: `height' undeclared (first use in this function)
checklist.c:85: `item_no' undeclared (first use in this function)
checklist.c:85: `choice' undeclared (first use in this function)
checklist.c: At top level:
checklist.c:103: syntax error before '*' token
checklist.c:104: warning: function declaration isn't a prototype
checklist.c: In function `print_buttons':
checklist.c:105: `width' undeclared (first use in this function)
checklist.c:106: `height' undeclared (first use in this function)
checklist.c:108: `dialog' undeclared (first use in this function)
checklist.c:108: `selected' undeclared (first use in this function)
checklist.c: In function `dialog_checklist':
checklist.c:126: `WINDOW' undeclared (first use in this function)
checklist.c:126: `dialog' undeclared (first use in this function)
checklist.c:126: `list' undeclared (first use in this function)
checklist.c:126: warning: left-hand operand of comma expression has no effect
checklist.c:132: warning: implicit declaration of function `endwin'
checklist.c:133: warning: implicit declaration of function `fprintf'
checklist.c:133: `stderr' undeclared (first use in this function)
checklist.c:148: `COLS' undeclared (first use in this function)
checklist.c:149: `LINES' undeclared (first use in this function)
checklist.c:151: `stdscr' undeclared (first use in this function)
checklist.c:153: warning: implicit declaration of function `newwin'
checklist.c:154: warning: implicit declaration of function `keypad'
checklist.c:154: `TRUE' undeclared (first use in this function)
checklist.c:187: warning: implicit declaration of function `subwin'
checklist.c:219: warning: implicit declaration of function `wnoutrefresh'
checklist.c:221: warning: implicit declaration of function `doupdate'
checklist.c:224: warning: implicit declaration of function `wgetch'
checklist.c:231: `KEY_UP' undeclared (first use in this function)
checklist.c:231: `KEY_DOWN' undeclared (first use in this function)
checklist.c:241: `FALSE' undeclared (first use in this function)
checklist.c:242: warning: implicit declaration of function `scrollok'
checklist.c:243: warning: implicit declaration of function `wscrl'
checklist.c:270: called object is not a function
checklist.c:305: warning: implicit declaration of function `delwin'
checklist.c:309: `KEY_LEFT' undeclared (first use in this function)
checklist.c:310: `KEY_RIGHT' undeclared (first use in this function)
/usr/include/bits/string2.h: At top level:
dialog.h:130: warning: array `attributes' assumed to have one element
make[1]: *** [checklist.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.21-40.EL/scripts/lxdialog'
make: *** [menuconfig] Error 2
 
 
 
经分析为缺少ncurses-devel包,原来只安装了ncurses包,现在补上
#yum install ncurses-devel
再次运行
#yum menuconfig 直接退出
#vi Makefile 将“EXTRAVERSION = -2.4.21-40ELcustom”改成“EXTRAVERSION = -2.4.21-40EL”
#cd /usr/src/patch-o-matic-ng-20060521
#KERNEL_DIR=/usr/src/linux-2.4.21-40.EL IPTABLES_DIR=/usr/src/iptables-1.3.5-20060521 ./runme.base
全是y
#cd /usr/src/linux-2.4.21-40.EL
#make menuconfig  确认第一项里面的[*]Prompt for development and/or incomplete code/drivers选中
进入 IP:Netfilter Configuration 将里面标有的按m键选上,esc保存,退出。
下面编译netfilter模块
#cd /usr/src/linux-2.4.21-40.EL
#head -n4 Makefile
#make dep
#make modules SUBDIRS=net/ipv4/netfilter
#cp -f net/ipv4/netfilter/*.o /lib/modules/2.4.21-40.EL/kernel/net/ipv4/netfilter/
#depmod -a
编译安装iptables
#cd /usr/src/iptables-1.3.5-20060521
#export KERNEL_DIR=/usr/src/linux-2.4
#export IPTABLES_DIR=/usr/src/iptables-1.3.5-20060521
#make BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/share/man install
#ln -s /lib/iptables /usr/local/lib/iptables (这步白金说可有可无,安全起见我写了一句)
 
测试一下吃否成功了:
#iptables -A FORWARD -m iprange --src-range 192.168.1.62-192.168.1.70 -j ACCEPT
#iptables -A OUTPUT -m time --timestart 8:00 --timestop 18:00 -j ACCEPT
#iptables -A FORWARD -m string --string "sex" -j DROP
#iptables -A FORWARD -m ipp2p --edk --bit -j DROP
经测试string和ipp2p模块不能用
于是去下载ipp2p-0.8.1_rc1.tar.gz
#tar xzvf ipp2p-0.8.1_rc1.tar.gz
#ln -s /usr/src/iptables-1.3.5-20060521 /usr/src/iptables
#cd /usr/src/ipp2p-0.8.1_rc1
#make
#cp libipt_ipp2p.so /lib/iptables/
#cp ipt_ipp2p.o /lib/modules/2.4.21-40.EL/kernel/net/ipv4/netfilter/
#iptables -A FORWARD -m ipp2p --edk --kazaa --bit -j DROP
成功加上ipp2p模块,因为string一时还用不上就没去解决
写到这吧,明天继续钻研别的东西。
 
阅读(1493) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~