再次见识了内核的伟大,大半年不碰,忘记的一干二净!!!写netfilter,netlink不得不提的就是九贱和duanjigang了... Linux 用户态与内核态的交互——netlink 篇 http://bbs.chinaunix.net/viewthread.php?tid=822500 netlink socket 编程之 why & how http://linux.chinaunix.net/bbs/viewthread.php?tid=1031932&extra=page%3D1%26amp%3Bfilter%3Ddigest 有了上面两篇文章加kernel source基本上你可以干许多...
by ubuntuer - 内核源码 - 2010-02-02 11:53:17 阅读(7255) 回复(15)
再次见识了内核的伟大,大半年不碰,忘记的一干二净!!!写netfilter,netlink不得不提的就是九贱和duanjigang了... Linux 用户态与内核态的交互——netlink 篇 http://bbs.chinaunix.net/viewthread.php?tid=822500 netlink socket 编程之 why & how http://linux.chinaunix.net/bbs/viewthread.php?tid=1031932&extra=page%3D1%26amp%3Bfilter%3Ddigest 有了上面两篇文章加kernel source基本上你可以干许多...
再次见识了内核的伟大,大半年不碰,忘记的一干二净!!!写netfilter,netlink不得不提的就是九贱和duanjigang了... Linux 用户态与内核态的交互——netlink 篇 http://bbs.chinaunix.net/viewthread.php?tid=822500 netlink socket 编程之 why & how http://linux.chinaunix.net/bbs/viewthread.php?tid=1031932&extra=page%3D1%26amp%3Bfilter%3Ddigest 有了上面两篇文章加kernel source基本上你可以干许多...
本帖最后由 HereItIs 于 2010-02-26 16:00 编辑 How conntrack works in netfilter(Part 2 - How to track FTP connections) 本文档基于Linux2.6.30内核,版权归hereitis所有,可以自由拷贝/转载,转载时请保持文档的完整性并且注明来源,禁止用于任何商业用途。 Blog:http://blog.chinaunix.net/u3/110948/ Email:hereitis.cu@gmail.com http://blog.chinaunix.net/u3/110948/showart.php?id=2166655 1. Initialization ...
netfilter在网络报文在协议栈的处理流程中插入钩子,插入点包括以下五个位置 #define NF_IP_PRE_ROUTING 0 /* If the packet is destined for this box. */ #define NF_IP_LOCAL_IN 1 /* If the packet is destined for another interface. */ #define NF_IP_FORWARD 2 /* Packets coming from a local process. */ #define NF_IP_LOCAL_OUT 3 /* Packets about to hit the wire. */ #define NF_I...
通俗的说,netfilter的架构就是在整个网络流程的若干位置放置了一些检测点(HOOK ),而在每个检测点上上登记了一些处理函数进行处理(如包过滤,NAT等,甚至可以是 用户自定义的功能)。 IP层的五个HOOK点的位置如下图所示(copy from ) : --->[1]--->[ROUTE]--->[3]--->[4]---> | ^ | | | [ROUTE] v | [2] [5] | ^ | | v | [local process] [1]:NF...
大家好,小弟最近学习netfilter遇到问题,希望CU的兄弟可以帮到我,先谢谢大家了。
先贴代码,原文可以在:http://hi.baidu.com/widebright/item/0c6c94b44e749c9619469784 看到
下面的代码仅仅在原文进行修改测试。
运行测试环境:rehl5.4 虚拟机 内核2.6.32[code]/*
* widebright.c
*
* Created on: 2009-10-13
* Author: widebright
*/
#include
本帖最后由 316953425 于 2014-03-18 16:42 编辑 我在linux中有两个网卡,eth0和eth1,把上述两个网卡放在一个br中, 当一个数据包从pc1发送到eth0中后,目的地址为eth1连接的pc2, 我想把这个数据的目的地址通过iptables 改为br上配置的ip, 然后让本机接收,通过抓包看,iptable的dnat怎么没发挥作用,数据包直接从eth1出去了 拓扑为: --------------- pc1 ----------> eth0 eth1-----------...