需求
实现url过滤功能,需要支持设置开始结束时间,支持设置周一到周末配置
功能实现
配置介绍
利用iptables的string匹配规则,内核需要配置以下配置
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_TIME=y
应用层需要配置iptables工具
iptables工具指令
# iptables -h
iptables v1.4.18
Usage: iptables -[ACD] chain rule-specification [options]
iptables -I chain [rulenum] rule-specification [options]
iptables -R chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
iptables -[LS] [chain [rulenum]] [options]
iptables -[FZ] [chain] [options]
iptables -[NX] chain
iptables -E old-chain-name new-chain-name
ipt