파일다운 : https://svn.assembla.com/svn/gargoyle-router/trunk/netfilter-match-modules/weburl/
# 커널소스에 복사 (커널소스 : /usr/src/linux)
cp -r module/* /usr/src/linux/net/ipv4/netfilter/
cp header/* /usr/src/linux/include/linux/netfilter_ipv4/
# /usr/src/linux/net/ipv4/netfilter/Kconfig 파일수정
- 가장마지막 라인 endmenu 위쪽에 아래 문구 삽입
config IP_NF_MATCH_WEBURL
tristate "WEBURL match support"
depends on IP_NF_IPTABLES
help
This option makes possible to match WEBURL
ranges.
To compile it as a module, choose M here. If unsure, say N.
# /usr/src/linux/net/ipv4/netfilter/Makefile 파일수정
- 가장 마지막 라인에 아래문구 삽입
obj-$(CONFIG_IP_NF_MATCH_WEBURL) += ipt_weburl.o
# make oldconfig 모듈체크
WEBURL match support (IP_NF_MATCH_WEBURL) [N/m/?] (NEW) m
# make modules && make modules_install
커널패치 완료.... The END
# iptables 수정
- 다운받은 파일 복사
cp extension/libipt_weburl.c /usr/src/iptables/extensions/
cp header/ipt_weburl.h /usr/src/iptables/include/linux/netfilter_ipv4
extension/libipt_weburl.c 수정
static struct iptables_match weburl = # 수정 iptables ==> xtables
{
.next = NULL,
.name = "weburl",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_weburl_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_weburl_info)),
.help = &help,
.parse = &parse,
.final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
};
void _init(void)
{
register_match(&webrul); # 수정 xtables_register_match
}
weburl options:
--contains [!] [STRING]
--contains_regex [!] [REGEX]
--matches_exactly [!] [STRING]
--domain_only
--path_only