- 论坛徽章:
- 0
|
原来的系统是RedHat9.0内核是2.4.20-8,iptables-v1.2.7a,netfilter内核模块可以自动加载,没问题,
但是升级内核到2.6.30后,netfilter内核模块都已编译好了,在/lib/modules/2.6.30中,安装iptables-v1.4.4(支持2.6.30的版本)后,配置如下规则:
# iptables -t mangle -A PREROUTING -p tcp -d 192.168.1.110/32 --dport 22-25 -j MARK --set-mark 1
出现如下信息:
iptables: No chain/target/match by that name.
查看了内核模块加载情况:
# lsmod
Module Size Used by Not tainted
iptable_mangle 2300 0 - Live 0xd0994000
ip_tables 9640 1 iptable_mangle, Live 0xd0988000
x_tables 14284 1 ip_tables, Live 0xd0979000
经过查实未加载的模块为:xt_tcpudp xt_MARK
# modprobe xt_tcpudp
# modprobe xt_MARK
经过手动加载这两个模块后在执行上述命令就没问题了,规则表情况如下:
# iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
MARK tcp -- anywhere 192.168.1.110 tcp dpts:ssh:smtp MARK xset 0x1/0xffffffff
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
虽然防火墙规则已正确执行了,但是不能像以前版本那样自动加载所需模块(注:确实自动加载了一些模块,但没加载完全),
还得手动加载:xt_tcpudp xt_MARK 这两个模块。
再此想问问大家到底是什么原因,如何使iptables自动完全加载完所需的模块? |
|