惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - will not update

汇编----串操作类指令 自己动手写操作系统(三) 自己动手写操作系统(二) 自己动手写操作系统(一) 讲解Linux下汇编语言的几篇文章 cs8900a驱动移植笔记 LCD驱动程序往2.6.11内核的移植总结 基于Linux2.6的YAFFS文件系统移植 Linux操作系统网络驱动程序编写 ramdisk+busybox howto 编译busybox支持嵌入式系统需要注意的几点 用MINICOM的XMODEM来传输文件 2.6.12内核移植到s3c2410需注意的几点 add yaffs fs to kernel port linux 2.6.11.7 kernel to s3c2410(SMDK2410) 安装FC4的“Less than 4MB of memory”问题解决 fedora core 3 安装 用Cisco router 做内部局域网 Linux操作系统下C语言编程入门
支持Netfilter的Linux以太网桥的建立
will not update · 2005-03-13 · via 博客园 - will not update

      今天终于把这个弄好了,前几天搞不好可能是RedHat9自带的Linux-2.4.20-8这个内核可能有问题。我现在用的是2.4.28的内核。好了,下面就来说下具体的做法。
       先来说说用2.4.20这个内核的情况。几天前我用2.4.20-8这个RedHat自带内核,2.4.20内核支持netfilter网桥需要以下几个补丁:
1)ebtables-v2.0.6.tar.gz
2)bridge-nf-0.0.10-against-2.4.20.diff.gz
3)ebtables-v2.0.003_vs_2.4.20.diff.gz
其中1)为用户进程,2)为bridge支持netfilter的补丁,3)ebtables的内核补丁。关于ebtables资料,请看这里
1)的安装:
gunzip ebtables-v2.0.6.tar.gz
tar vxf ebtables-v2.0.6.tar
cd ebtables-v2.0.6
make
make install
2)和3)要先打3)的补丁,先打2)会出错:
解压后
cd /usr/src/linux-2.4
patch -p1 /.../ebtables-v2.0.003_vs_2.4.20.diff
patch -p1 /.../bridge-nf-0.0.10-against-2.4.20.diff
好了,接下来就是编译内核,具体不说了,内核中选上如下选项:
Code maturity level options
[*] Prompt for development and/or incomplete code/drivers
Loadable module support
[*] Enable loadable module support  
[*] Set version information on all module symbols
[*] Kernel module loader
Networking options
[*] Network packet filtering (replaces ipchains)
[*] Network packet filtering debugging
IP: Netfilter Configuration (其下所有选项都设为M)
[*]802.1d Ethernet Bridging
[*]ebtables(NEW)(把有关ebtables的全选中)
好了,编译生成内核后重起进入新内核。
建立网桥(Linux内核2.2以上都支持网桥,并有其配置工具brctl):
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig br0 up
照理说内核应该支持netfilter了,但我试了一下:
ebtables -A FORWARD -p IPv4 --ip-src 172.16.1.4 -s ! 00:11:22:33:44:55 -j DROP
提示竟然是内核不支持ebtables,晕啊!我编译内核了好几次都是这样。
去网上找找,发现MAIL-LIST上也有人用这个内核出现过错误,不过有的人说从kernel.org上下的2.4.20内核可以用(不知道谁试过没有,还有不知道有没老兄用RedHat自带内核成功的),反正要下载内核了,我就下了个新一点的内核:2.4.28。因为2.4.29ebtables还不支持。至于2.6,虽然不用打补丁和安装程序,但以前编译内核后进不了系统(只编译了一次,懒的试了,呵呵),况且怕它的网络部分代码与2.4不同,会给以后编程带来麻烦。
       好了,2.4.21以上的补丁都只需要一个补丁,下载支持2.4.28的:
ebtables-brnf-8-3_vs_2.4.28.diff.gz
当然了,用户程序还是要的:
ebtables-v2.0.6.tar.gz
然后照上面所说的打补丁,编译内核,具体细节不说了(我第一次编译,竟然忘了让内核支持我的网卡,呵呵)。
当内核启动成功后,再试:
ebtables -A FORWARD -p IPv4 --ip-src 172.16.1.4 -s ! 00:11:22:33:44:55 -j DROP
就通过了。
你试着用三台电脑测试一下,怎么样,成功了吧!具体的一些配置和man手册,这里都可以找到:ebtables.sourceforge.net