免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: fangjiafu
打印 上一主题 下一主题

[网络管理] centos添加iptables 模块的问题 多次尝试没有解决,请大家帮忙 谢谢! [复制链接]

论坛徽章:
0
11 [报告]
发表于 2009-12-08 16:53 |只看该作者
原帖由 fangjiafu 于 2009-12-8 16:51 发表
1.4.5的iptables 安装在 /usr/local下面了! 我再重新编译一遍,把整个过程发上来!

谢谢!

好的,整理一下你的全部过程,这样才好分析

论坛徽章:
0
12 [报告]
发表于 2009-12-08 20:29 |只看该作者
原帖由 platinum 于 2009-12-8 16:53 发表

好的,整理一下你的全部过程,这样才好分析

[root@FJF src]# uname -r
2.6.18-128.el5
[root@FJF ~]# ls
anaconda-ks.cfg  install.log         iptables-1.4.0.tar.tar  patch-o-matic-ng-20091202.tar.tar
Desktop          install.log.syslog  linux-2.6.18.tar.bz2

tar xjvf iptables-1.4.0.tar.tar -C /usr/src/

tar xjvf patch-o-matic-ng-20091202.tar.tar  -C /usr/src/

  tar xjvf linux-2.6.18.tar.bz2 -C /usr/src/

  cd /usr/src/

   mv iptables-1.4.0/ iptables
   mv linux-2.6.18/ linux
   cd iptables/
   make KERNEL_DIR=/usr/src/linux/ BINDIR=/sbin/ LIBDIR=/lib/ MANDIR=/usr/man
   make KERNEL_DIR=/usr/src/linux/ BINDIR=/sbin/ LIBDIR=/lib/ MANDIR=/usr/man install
[root@FJF src]# iptables -V
iptables v1.4.0
[root@FJF iptables]# date
Wed Dec  9 03:23:21 CST 2009
[root@FJF src]# cd /lib/iptables/
[root@FJF iptables]# ll
total 1612
-rwxr-xr-x 1 root root  7917 Dec  9 03:16 libip6t_ah.so
-rwxr-xr-x 1 root root  4648 May 25  2008 libip6t_connmark.so
-rwxr-xr-x 1 root root  5848 May 25  2008 libip6t_CONNMARK.so
-rwxr-xr-x 1 root root  8024 Dec  9 03:16 libip6t_dst.so
-rwxr-xr-x 1 root root  4671 Dec  9 03:16 libip6t_eui64.so
-rwxr-xr-x 1 root root  8348 Dec  9 03:16 libip6t_frag.so
-rwxr-xr-x 1 root root  8056 Dec  9 03:16 libip6t_hbh.so
-rwxr-xr-x 1 root root  6254 Dec  9 03:16 libip6t_hl.so
-rwxr-xr-x 1 root root  6294 Dec  9 03:16 libip6t_HL.so
-rwxr-xr-x 1 root root  8431 Dec  9 03:16 libip6t_icmp6.so
-rwxr-xr-x 1 root root  6756 May 25  2008 libip6t_icmpv6.so
-rwxr-xr-x 1 root root  8296 Dec  9 03:16 libip6t_ipv6header.so
-rwxr-xr-x 1 root root  5124 May 25  2008 libip6t_length.so
-rwxr-xr-x 1 root root  5876 May 25  2008 libip6t_limit.so
-rwxr-xr-x 1 root root  8604 Dec  9 03:16 libip6t_LOG.so
-rwxr-xr-x 1 root root  4612 May 25  2008 libip6t_mac.so
-rwxr-xr-x 1 root root  4580 May 25  2008 libip6t_mark.so
-rwxr-xr-x 1 root root  4292 May 25  2008 libip6t_MARK.so
-rwxr-xr-x 1 root root  8116 Dec  9 03:16 libip6t_mh.so
-rwxr-xr-x 1 root root  6472 May 25  2008 libip6t_multiport.so
-rwxr-xr-x 1 root root  4168 May 25  2008 libip6t_NFQUEUE.so
-rwxr-xr-x 1 root root  7938 Dec  9 03:16 libip6t_owner.so
-rwxr-xr-x 1 root root  5864 May 25  2008 libip6t_physdev.so
-rwxr-xr-x 1 root root 12754 Dec  9 03:16 libip6t_policy.so
-rwxr-xr-x 1 root root  6749 Dec  9 03:16 libip6t_REJECT.so
-rwxr-xr-x 1 root root 10031 Dec  9 03:16 libip6t_rt.so
-rwxr-xr-x 1 root root  3428 May 25  2008 libip6t_standard.so
-rwxr-xr-x 1 root root  5060 May 25  2008 libip6t_state.so
-rwxr-xr-x 1 root root  8740 May 25  2008 libip6t_tcp.so
-rwxr-xr-x 1 root root  3328 May 25  2008 libip6t_TRACE.so
-rwxr-xr-x 1 root root  6388 May 25  2008 libip6t_udp.so
-rwxr-xr-x 1 root root  8025 Dec  9 03:16 libipt_addrtype.so
-rwxr-xr-x 1 root root  6893 Dec  9 03:16 libipt_ah.so
-rwxr-xr-x 1 root root  4424 May 25  2008 libipt_CLASSIFY.so
-rwxr-xr-x 1 root root  8626 Dec  9 03:16 libipt_CLUSTERIP.so
-rwxr-xr-x 1 root root  4292 May 25  2008 libipt_comment.so
-rwxr-xr-x 1 root root  4696 May 25  2008 libipt_connlimit.so
-rwxr-xr-x 1 root root  4648 May 25  2008 libipt_connmark.so
-rwxr-xr-x 1 root root  5848 May 25  2008 libipt_CONNMARK.so
-rwxr-xr-x 1 root root 12080 Dec  9 03:16 libipt_conntrack.so
-rwxr-xr-x 1 root root  8052 May 25  2008 libipt_dccp.so
-rwxr-xr-x 1 root root  8016 Dec  9 03:16 libipt_DNAT.so
-rwxr-xr-x 1 root root  6004 May 25  2008 libipt_dscp.so
-rwxr-xr-x 1 root root  6004 May 25  2008 libipt_DSCP.so
-rwxr-xr-x 1 root root  6714 Dec  9 03:16 libipt_ecn.so
-rwxr-xr-x 1 root root  6557 Dec  9 03:16 libipt_ECN.so
-rwxr-xr-x 1 root root  5344 May 25  2008 libipt_esp.so
-rwxr-xr-x 1 root root  9432 May 25  2008 libipt_hashlimit.so
-rwxr-xr-x 1 root root  4228 May 25  2008 libipt_helper.so
-rwxr-xr-x 1 root root  8708 Dec  9 03:16 libipt_icmp.so
-rwxr-xr-x 1 root root  6998 Dec  9 03:16 libipt_iprange.so
-rwxr-xr-x 1 root root  5092 May 25  2008 libipt_length.so
-rwxr-xr-x 1 root root  5876 May 25  2008 libipt_limit.so
-rwxr-xr-x 1 root root  8600 Dec  9 03:16 libipt_LOG.so
-rwxr-xr-x 1 root root  4608 May 25  2008 libipt_mac.so
-rwxr-xr-x 1 root root  4580 May 25  2008 libipt_mark.so
-rwxr-xr-x 1 root root  5924 May 25  2008 libipt_MARK.so
-rwxr-xr-x 1 root root  6467 Dec  9 03:16 libipt_MASQUERADE.so
-rwxr-xr-x 1 root root  4613 Dec  9 03:16 libipt_MIRROR.so
-rwxr-xr-x 1 root root  8968 May 25  2008 libipt_multiport.so
-rwxr-xr-x 1 root root  6574 Dec  9 03:16 libipt_NETMAP.so
-rwxr-xr-x 1 root root  4164 May 25  2008 libipt_NFQUEUE.so
-rwxr-xr-x 1 root root  3300 May 25  2008 libipt_NOTRACK.so
-rwxr-xr-x 1 root root  8555 Dec  9 03:16 libipt_owner.so
-rwxr-xr-x 1 root root  5860 May 25  2008 libipt_physdev.so
-rwxr-xr-x 1 root root  4932 May 25  2008 libipt_pkttype.so
-rwxr-xr-x 1 root root 11344 Dec  9 03:16 libipt_policy.so
-rwxr-xr-x 1 root root  8221 Dec  9 03:16 libipt_realm.so
-rwxr-xr-x 1 root root  9679 Dec  9 03:16 libipt_recent.so
-rwxr-xr-x 1 root root  6579 Dec  9 03:16 libipt_REDIRECT.so
-rwxr-xr-x 1 root root  8030 Dec  9 03:16 libipt_REJECT.so
-rwxr-xr-x 1 root root  7696 May 25  2008 libipt_rpc.so
-rwxr-xr-x 1 root root  7071 Dec  9 03:16 libipt_SAME.so
-rwxr-xr-x 1 root root 10532 May 25  2008 libipt_sctp.so
-rwxr-xr-x 1 root root  8016 Dec  9 03:16 libipt_SNAT.so
-rwxr-xr-x 1 root root  3432 May 25  2008 libipt_standard.so
-rwxr-xr-x 1 root root  5060 May 25  2008 libipt_state.so
-rwxr-xr-x 1 root root  7716 May 25  2008 libipt_string.so
-rwxr-xr-x 1 root root  3428 May 25  2008 libipt_TARPIT.so
-rwxr-xr-x 1 root root  4964 May 25  2008 libipt_tcpmss.so
-rwxr-xr-x 1 root root  4500 May 25  2008 libipt_TCPMSS.so
-rwxr-xr-x 1 root root  8736 May 25  2008 libipt_tcp.so
-rwxr-xr-x 1 root root  6904 Dec  9 03:16 libipt_tos.so
-rwxr-xr-x 1 root root  6529 Dec  9 03:16 libipt_TOS.so
-rwxr-xr-x 1 root root  3300 May 25  2008 libipt_TRACE.so
-rwxr-xr-x 1 root root  6423 Dec  9 03:16 libipt_ttl.so
-rwxr-xr-x 1 root root  6331 Dec  9 03:16 libipt_TTL.so
-rwxr-xr-x 1 root root  6384 May 25  2008 libipt_udp.so
-rwxr-xr-x 1 root root  7889 Dec  9 03:16 libipt_ULOG.so
-rwxr-xr-x 1 root root  4611 Dec  9 03:16 libipt_unclean.so
-rwxr-xr-x 1 root root  5908 Dec  9 03:16 libxt_CLASSIFY.so
-rwxr-xr-x 1 root root  6174 Dec  9 03:16 libxt_comment.so
-rwxr-xr-x 1 root root  8059 Dec  9 03:16 libxt_connbytes.so
-rwxr-xr-x 1 root root  8120 Dec  9 03:16 libxt_connlimit.so
-rwxr-xr-x 1 root root  6385 Dec  9 03:16 libxt_connmark.so
-rwxr-xr-x 1 root root  7283 Dec  9 03:16 libxt_CONNMARK.so
-rwxr-xr-x 1 root root  9641 Dec  9 03:16 libxt_dccp.so
-rwxr-xr-x 1 root root  8228 Dec  9 03:16 libxt_dscp.so
-rwxr-xr-x 1 root root  7245 Dec  9 03:16 libxt_DSCP.so
-rwxr-xr-x 1 root root  6997 Dec  9 03:16 libxt_esp.so
-rwxr-xr-x 1 root root 11680 Dec  9 03:16 libxt_hashlimit.so
-rwxr-xr-x 1 root root  5972 Dec  9 03:16 libxt_helper.so
-rwxr-xr-x 1 root root  6868 Dec  9 03:16 libxt_length.so
-rwxr-xr-x 1 root root  7470 Dec  9 03:16 libxt_limit.so
-rwxr-xr-x 1 root root  6404 Dec  9 03:16 libxt_mac.so
-rwxr-xr-x 1 root root  6349 Dec  9 03:16 libxt_mark.so
-rwxr-xr-x 1 root root  7053 Dec  9 03:16 libxt_MARK.so
-rwxr-xr-x 1 root root 11757 Dec  9 03:16 libxt_multiport.so
-rwxr-xr-x 1 root root  8036 Dec  9 03:16 libxt_NFLOG.so
-rwxr-xr-x 1 root root  5830 Dec  9 03:16 libxt_NFQUEUE.so
-rwxr-xr-x 1 root root  4816 Dec  9 03:16 libxt_NOTRACK.so
-rwxr-xr-x 1 root root  8072 Dec  9 03:16 libxt_physdev.so
-rwxr-xr-x 1 root root  6819 Dec  9 03:16 libxt_pkttype.so
-rwxr-xr-x 1 root root  5947 Dec  9 03:16 libxt_quota.so
-rwxr-xr-x 1 root root 12886 Dec  9 03:16 libxt_sctp.so
-rwxr-xr-x 1 root root  4853 Dec  9 03:16 libxt_standard.so
-rwxr-xr-x 1 root root  6850 Dec  9 03:16 libxt_state.so
-rwxr-xr-x 1 root root  7988 Dec  9 03:16 libxt_statistic.so
-rwxr-xr-x 1 root root  9588 Dec  9 03:16 libxt_string.so
-rwxr-xr-x 1 root root  6778 Dec  9 03:16 libxt_tcpmss.so
-rwxr-xr-x 1 root root  6483 Dec  9 03:16 libxt_TCPMSS.so
-rwxr-xr-x 1 root root 10379 Dec  9 03:16 libxt_tcp.so
-rwxr-xr-x 1 root root 12713 Dec  9 03:16 libxt_time.so
-rwxr-xr-x 1 root root  4806 Dec  9 03:16 libxt_TRACE.so
-rwxr-xr-x 1 root root  8346 Dec  9 03:16 libxt_u32.so
-rwxr-xr-x 1 root root  8155 Dec  9 03:16 libxt_udp.so

[root@FJF iptables]#  iptables -A INPUT -m connlimit --connlimit-above 10 -j DROP
iptables: No chain/target/match by that name
[root@FJF iptables]# lsmod
Module                  Size  Used by
iptable_filter          7105  0
ip_tables              17029  1 iptable_filter
x_tables               17349  1 ip_tables
ipv6                  261473  16
xfrm_nalgo             13381  1 ipv6
crypto_api             12609  1 xfrm_nalgo
dm_multipath           24013  0
scsi_dh                11713  1 dm_multipath
video                  21193  0
hwmon                   7365  0
backlight              10049  1 video
sbs                    18533  0
i2c_ec                  9025  1 sbs
button                 10705  0
battery                13637  0
asus_acpi              19289  0
ac                      9157  0
lp                     15849  0
floppy                 57125  0
snd_ens1371            28513  0
gameport               18633  1 snd_ens1371
snd_rawmidi            26561  1 snd_ens1371
snd_ac97_codec         93025  1 snd_ens1371
ac97_bus                6337  1 snd_ac97_codec
snd_seq_dummy           7877  0
snd_seq_oss            32577  0
snd_seq_midi_event     11073  1 snd_seq_oss
snd_seq                49585  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device         11725  4 snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss            42817  0
snd_mixer_oss          19009  1 snd_pcm_oss
snd_pcm                72133  3 snd_ens1371,snd_ac97_codec,snd_pcm_oss
snd_timer              24517  2 snd_seq,snd_pcm
snd                    55237  10 snd_ens1371,snd_rawmidi,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
pcnet32                35269  0
mii                     9409  1 pcnet32
soundcore              11553  1 snd
snd_page_alloc         14281  1 snd_pcm
pcspkr                  7105  0
i2c_piix4              12237  0
i2c_core               23745  2 i2c_ec,i2c_piix4
parport_pc             29157  1
parport                37513  2 lp,parport_pc
ide_cd                 40161  0
serio_raw              10693  0
cdrom                  36577  1 ide_cd
dm_raid45              66509  0
dm_message              6977  1 dm_raid45
dm_region_hash         15681  1 dm_raid45
[root@FJF iptables]# insmod /lib/iptables/libipt_connlimit.so
insmod: error inserting '/lib/iptables/libipt_connlimit.so': -1 Invalid module format

dm_mem_cache            9537  1 dm_raid45
dm_snapshot            22245  0
dm_zero                 6209  0
dm_mirror              22981  0
dm_log                 14529  3 dm_raid45,dm_region_hash,dm_mirror
dm_mod                 62201  11 dm_multipath,dm_raid45,dm_snapshot,dm_zero,dm_mirror,dm_log
ata_piix               23621  0
libata                156677  1 ata_piix
sd_mod                 25153  0
scsi_mod              141589  3 scsi_dh,libata,sd_mod
ext3                  124233  2
jbd                    56937  1 ext3
uhci_hcd               25421  0
ohci_hcd               24681  0
ehci_hcd               33357  0
[root@FJF iptables]# insmod /lib/iptables/libipt_connlimit.so
insmod: error inserting '/lib/iptables/libipt_connlimit.so': -1 Invalid module format

论坛徽章:
0
13 [报告]
发表于 2009-12-08 20:31 |只看该作者
原帖由 platinum 于 2009-12-8 16:53 发表

好的,整理一下你的全部过程,这样才好分析



我发现安装iptables 都出现了错误,我好像哪里理解错了,网上查iptables1.4.5与以前有点差距,我安装1.4.0试试

麻烦 白金版主 指点!12L为iptables 1.4。0的安装过程!

非常感谢!

[ 本帖最后由 fangjiafu 于 2009-12-9 09:08 编辑 ]

论坛徽章:
0
14 [报告]
发表于 2009-12-09 09:43 |只看该作者
白金版主 查阅了一下以前论坛里面的相关信息,发现/lib/modules/2.6.18/kernel/net/ipv4/netfilter没有ip_connlimit.ko,内核是2.6.18,默认支持了吧。

[root@FJF netfilter]# ls
arptable_filter.ko          ip_conntrack_proto_sctp.ko  ip_nat_tftp.ko     ipt_DSCP.ko        ipt_REJECT.ko
arp_tables.ko               ip_conntrack_sip.ko         ip_queue.ko        ipt_ecn.ko         ipt_SAME.ko
arpt_mangle.ko              ip_conntrack_tftp.ko        iptable_filter.ko  ipt_ECN.ko         ipt_TCPMSS.ko
ip_conntrack_amanda.ko      ip_nat_amanda.ko            iptable_mangle.ko  ipt_hashlimit.ko   ipt_tos.ko
ip_conntrack_ftp.ko         ip_nat_ftp.ko               iptable_nat.ko     ipt_iprange.ko     ipt_TOS.ko
ip_conntrack_h323.ko        ip_nat_h323.ko              iptable_raw.ko     ipt_LOG.ko         ipt_ttl.ko
ip_conntrack_irc.ko         ip_nat_irc.ko               ip_tables.ko       ipt_MASQUERADE.ko  ipt_TTL.ko
ip_conntrack.ko             ip_nat.ko                   ipt_addrtype.ko    ipt_NETMAP.ko      ipt_ULOG.ko
ip_conntrack_netbios_ns.ko  ip_nat_pptp.ko              ipt_ah.ko          ipt_owner.ko
ip_conntrack_netlink.ko     ip_nat_sip.ko               ipt_CLUSTERIP.ko   ipt_recent.ko
ip_conntrack_pptp.ko        ip_nat_snmp_basic.ko        ipt_dscp.ko        ipt_REDIRECT.ko
[root@FJF netfilter]# pwd
/lib/modules/2.6.18/kernel/net/ipv4/netfilter
[root@FJF netfilter]#

论坛徽章:
0
15 [报告]
发表于 2009-12-09 09:53 |只看该作者
重新make menuconfig 确认了一下没有找到 connlimit模块,我可能眼花了,我记得看见过!

终于知道自己错在哪里了! 在那里加载一个不是自带的模块!

重新加载试试! 希望成功!

论坛徽章:
0
16 [报告]
发表于 2009-12-09 09:57 |只看该作者
白金版主 问一下  iptables 1.4.0已经支持 connlimit 我是不是 只需要用patch-o-matic-ng 对内核进行补丁?

论坛徽章:
0
17 [报告]
发表于 2009-12-09 10:45 |只看该作者

回复 #11 platinum 的帖子

154  cd patch-o-matic-ng-20091202/
  155  ls
  156  ./runme --download
  157  ./runme connlimit
  158  ls
  159  man iptables
  160  cd /usr/src/linux/
  161  ls
  162  history
  163  make modules_prepare
  164  make M=net/ipv4/netfilter
  165  cp net/ipv4/netfilter/ipt_connlimit.ko /lib/modules/2.6.18/kernel/net/ipv4/netfilter/
  166  chmod +x /lib/modules/2.6.18/kernel/net/ipv4/netfilter/*.ko
  167  iptables -A INPUT -m connlimit --connlimit-above 100 -j DROP
  168  depmod -a
  169  modprobe ipt_connlimit
对内核补丁了一下:仍然报错:
[root@FJF iptables]#  iptables -I INPUT -p tcp  --dport 23 -m connlimit --connlimit-above 2 -j REJECT
iptables: Invalid argument
认为是iptables没有重新编译影响:
重新编译:
191  make KERNEL_DIR=/usr/src/linux/ BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/man
  192  make KERNEL_DIR=/usr/src/linux/ BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/man install
  193   iptables -I INPUT -p tcp  --dport 23 -m connlimit --connlimit-above 2 -j DROP
[root@FJF iptables]# iptables -I INPUT -p tcp  --dport 23 -m connlimit --connlimit-above 2 -j DROP
iptables: Invalid argument
仍然报错
[root@FJF iptables]# lsmod
Module                  Size  Used by
ipt_connlimit           7552  0
ip_conntrack           54752  1 ipt_connlimit
nfnetlink              10776  1 ip_conntrack
ipt_recent             12560  1
xt_tcpudp               7296  1
iptable_filter          7168  1
ip_tables              17476  1 iptable_filter
x_tables               17668  4 ipt_connlimit,ipt_recent,xt_tcpudp,ip_tables
ipv6                  242720  16
dm_multipath           20872  0
video                  19204  0

论坛徽章:
0
18 [报告]
发表于 2009-12-09 10:54 |只看该作者
原帖由 fangjiafu 于 2009-12-9 09:57 发表
白金版主 问一下  iptables 1.4.0已经支持 connlimit 我是不是 只需要用patch-o-matic-ng 对内核进行补丁?

是的
但是编译 iptables 时也需要依赖内核头文件
1.4.0 比较新,2.6.18 内核比较老,二者未必匹配,编译未必可以正常通过,这是我比较担心的

论坛徽章:
0
19 [报告]
发表于 2009-12-13 22:15 |只看该作者

回复 #18 platinum 的帖子

结贴:
非常感谢 白金版主的指点,现在将centos 5.3下的步骤总结如下:
那些对内核和iptables编译不熟悉的,可以用一下方法.
1、安装内核源码
useradd  mockbuild
rpm -ivh kernel-2.6.18-128.el5.src.rpm
cd /usr/src/redhat/SPECS/
rpmbuild -bp --target=i686 kernel-2.6.spec
cd /usr/src/redhat/BUILD/kernel-2.6.18
cp -a linux-2.6.18.i686 /usr/src
2、解压iptables
tar xjvf iptables-1.3.5.tar.tar -C /usr/src
3、解压ipp2p
tar zxvf ipp2p-0.8.2.tar.tar -C /usr/src
4、编译ipp2p
cd /usr/src/ipp2p-0.8.2
[root@localhost ipp2p-0.8.2]# ls
COPYING  ipt_ipp2p.c  ipt_ipp2p.h  libipt_ipp2p.c  Makefile  Module.markers  Module.symvers  README
[root@localhost ipp2p-0.8.2]# make
make -C /lib/modules/2.6.18-128.el5/build SUBDIRS=/usr/src/ipp2p-0.8.2 modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-128.el5-i686'
  CC [M]  /usr/src/ipp2p-0.8.2/ipt_ipp2p.o
  Building modules, stage 2.
  MODPOST
  CC      /usr/src/ipp2p-0.8.2/ipt_ipp2p.mod.o
  LD [M]  /usr/src/ipp2p-0.8.2/ipt_ipp2p.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-128.el5-i686'
gcc -O3 -Wall -DIPTABLES_VERSION=\"1.3.5\" -I/usr/src/iptables-1.3.5/include -fPIC -c libipt_ipp2p.c
ld -shared -o libipt_ipp2p.so libipt_ipp2p.o
编译后的libipt_ipp2p.so为iptables应用的模块
        ipt_ipp2p.ko为内核需要的模块
5、将编译后的文件复制到相应的文件夹中。

cp libipt_ipp2p.so /lib/iptables/

cp ipt_ipp2p.ko /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/

chmod +x /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/ipt_ipp2p.ko

6、重启iptables测试。

iptables -A FORWARD -m ipp2p --edk --kazaa --bit -j DROP
iptables -A FORWARD -p tcp -m ipp2p --ares -j DROP
iptables -A FORWARD -p udp -m ipp2p --kazaa -j DROP

效果没有具体环境没测试!
有测试过的朋友 可以发表一下意见!谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP