海运的博客

OpenWRT编译安装Iptables IPID模块

发布时间:September 15, 2012 // 分类:OpenWrt // 4 Comments

之前有介绍Openwrt下IPID模块的使用及自己编译的Openwrt IPID固件下载,本次记录下编译过程。
Openwrt源码根目录下编辑:

include/netfilter.mk

在ipopt软件包下添加:

$(eval $(call nf_add,IPT_IPOPT,CONFIG_NETFILTER_XT_TARGET_IPID, $(P_XT)xt_IPID))

编辑:

package/iptables/Makefile

在HL下添加:

- IPID

编辑:

package/kernel/modules/netfilter.mk

在TTL下添加:

 - IPID 

下载dev.openwrt.org.cn提供的IPID源码patch:

#https://www.haiyun.me
wget -P package/iptables/patches/ https://dev.openwrt.org.cn/export/553/trunk/package/iptables/patches/006-iptable-ipid.patch
wget -P target/linux/generic-2.6/patches-2.6.32/ https://dev.openwrt.org.cn/export/553/trunk/target/linux/generic/patches-2.6.32/995-netfilter_linux-ipid.patch

修改iptable-ipid.patch第二行为:

+++ b/extensions/libxt_IPID.c

然后编译Openwrt固件,选择IPOPT软件包即可。

发个自己编译的OpenWRT官方稳定版加IPID/TTL固件下载

发布时间:September 14, 2012 // 分类:OpenWrt // 4 Comments

使用Openwrt官方源最新稳定版编译,添加IPID/TTL模块,适用于RG100AA和DB120。
linux内核版本:

Linux OpenWrt 2.6.32.27 #2 Fri Sep 14 17:12:10 CST 2012 mips GNU/Linux

编译安装的软件如下:

opkg list-installed
base-files - 43.35-r33081
bash - 4.2-2
busybox - 1.15.3-3.4
crda - 1.1.1-1
ddns-scripts - 1.0.0-18
dnsmasq - 2.55-6.1
dropbear - 0.53.1-6
gpioctl - 1.0-1
hotplug2 - 1.0-beta-3
ip - 2.6.29-1-2
iptables - 1.4.6-3.1
iptables-mod-conntrack - 1.4.6-3.1
iptables-mod-conntrack-extra - 1.4.6-3.1
iptables-mod-extra - 1.4.6-3.1
iptables-mod-filter - 1.4.6-3.1
iptables-mod-hashlimit - 1.4.6-3.1
iptables-mod-imq - 1.4.6-3.1
iptables-mod-ipopt - 1.4.6-3.1
iptables-mod-ipsec - 1.4.6-3.1
iptables-mod-nat - 1.4.6-3.1
iptables-mod-nat-extra - 1.4.6-3.1
iw - 0.9.22-2
kernel - 2.6.32.27-1
kmod-b43 - 2.6.32.27+2011-12-01-1
kmod-cfg80211 - 2.6.32.27+2011-12-01-1
kmod-crc-ccitt - 2.6.32.27-1
kmod-crypto-aes - 2.6.32.27-1
kmod-crypto-arc4 - 2.6.32.27-1
kmod-crypto-core - 2.6.32.27-1
kmod-fs-ext3 - 2.6.32.27-1
kmod-fs-ntfs - 2.6.32.27-1
kmod-fs-vfat - 2.6.32.27-1
kmod-ipt-conntrack - 2.6.32.27-1
kmod-ipt-conntrack-extra - 2.6.32.27-1
kmod-ipt-core - 2.6.32.27-1
kmod-ipt-extra - 2.6.32.27-1
kmod-ipt-filter - 2.6.32.27-1
kmod-ipt-hashlimit - 2.6.32.27-1
kmod-ipt-imq - 2.6.32.27-1
kmod-ipt-ipopt - 2.6.32.27-1
kmod-ipt-ipsec - 2.6.32.27-1
kmod-ipt-nat - 2.6.32.27-1
kmod-ipt-nat-extra - 2.6.32.27-1
kmod-mac80211 - 2.6.32.27+2011-12-01-1
kmod-macvlan - 2.6.32.27-1
kmod-nls-base - 2.6.32.27-1
kmod-nls-cp437 - 2.6.32.27-1
kmod-nls-iso8859-1 - 2.6.32.27-1
kmod-nls-utf8 - 2.6.32.27-1
kmod-ppp - 2.6.32.27-1
kmod-pppoe - 2.6.32.27-1
kmod-sched - 2.6.32.27-1
kmod-scsi-core - 2.6.32.27-1
kmod-switch - 2.6.32.27-4
kmod-textsearch - 2.6.32.27-1
kmod-usb-core - 2.6.32.27-1
kmod-usb-ohci - 2.6.32.27-1
kmod-usb-storage - 2.6.32.27-1
kmod-usb2 - 2.6.32.27-1
l7-protocols - 2009-05-28-1
libc - 0.9.30.1-43.35
libevent2 - 2.0.16-1
libgcc - 4.3.3+cs-43.35
libip4tc - 1.4.6-3.1
libiwinfo - 18.2
libiwinfo-lua - 18.2
liblua - 5.1.4-7
libncurses - 5.7-2
libnl-tiny - 0.1-2.1
libopenssl - 0.9.8x-1
libpcap - 1.0.0-2
libpthread - 0.9.30.1-43.35
librt - 0.9.30.1-43.35
libuci - 12012009.7-4
libuci-lua - 12012009.7-4
libxtables - 1.4.6-3.1
lrzsz - 0.12.20-2
lua - 5.1.4-7
luci-app-ddns - 0.10+svn9273-1
luci-i18n-chinese - 0.10+svn9273-1
luci-i18n-english - 0.10+svn9273-1
luci-lib-core - 0.10+svn9273-1
luci-lib-ipkg - 0.10+svn9273-1
luci-lib-lmo - 0.10+svn9273-1
luci-lib-nixio - 0.10+svn9273-1
luci-lib-sys - 0.10+svn9273-1
luci-lib-web - 0.10+svn9273-1
luci-mod-admin-core - 0.10+svn9273-1
luci-mod-admin-full - 0.10+svn9273-1
luci-proto-core - 0.10+svn9273-1
luci-proto-ppp - 0.10+svn9273-1
luci-sgi-cgi - 0.10+svn9273-1
luci-sgi-uhttpd - 0.10+svn9273-1
luci-theme-base - 0.10+svn9273-1
luci-theme-openwrt - 0.10+svn9273-1
mtd - 13
openssh-client - 5.9p1-4
opkg - 576-2
ppp - 2.4.4-16.1
ppp-mod-pppoe - 2.4.4-16.1
tc - 2.6.29-1-2
tcpdump - 4.1.1-2
tmux - 1.6-2
uci - 12012009.7-4
udevtrigger - 106-1
uhttpd - 28.1
uhttpd-mod-lua - 28.1
wireless-tools - 29-4
wpad-mini - 20111103-3
zlib - 1.2.3-5

IPID及TTL使用参数参考:Openwrt/Linux使用IPID和TTL模块防网络尖兵

Centos编译IPID模块配置TTL防网络尖兵

发布时间:July 30, 2012 // 分类:Iptables // No Comments

Centos自带iptables TTL模块,IPID源码下载地址:http://bbs.chinaunix.net/thread-2102211-1-1.html

#https://www.haiyun.me
yum -y install kernel-devel
wget http://ftp.netfilter.org/pub/iptables/iptables-1.3.5.tar.bz2
tar jxvf iptables-1.3.5.tar.bz2
ln -s iptables-1.3.5 /usr/src/iptables

编译安装IPID:

cd iptables-ipid-2.1
sed -i 's/new_ipid\[i\]/new_ipid\[id\]/g' ipt_IPID.c
make
cp ipt_IPID.ko /lib/modules/2.6.18-308.11.1.el5/kernel/net/ipv4/netfilter/
chmod 744 /lib/modules/2.6.18-308.11.1.el5/kernel/net/ipv4/netfilter/ipt_IPID.ko
cp libipt_IPID.so /lib/iptables/
depmod -a
modprobe ipt_IPID

使用参数:

--ipid-pace [number] 设置每次增加的步调值,如果为0,则数据包的IPID字段应该为一个固定的值。
--ipid-choatic 0 设置随机IPID。0仅仅是填充参数作用。

应用示例:

iptables -t mangle -A PREROUTING  -i pppoe-wan -j TTL --ttl-inc 1
#限制2级路由
iptables -t mangle -A POSTROUTING -o pppoe-wan -j TTL --ttl-set 128
iptables -t mangle -A POSTROUTING -o pppoe-wan -j IPID --ipid-pace 1
#这样路由本机和下级电脑发的数据都修改TTL和IPID信息,修改TTL会导致tracert跟踪不正常。
#如需不影响路由本机tracert可在FORWARD链修改数据包信息
分类
最新文章
最近回复
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...