NetDC
linux上的bridge和vlan
将一台linux配置成bridge的模式,但是发现交换机打了tag 的包没法通过,发现在/proc/sys/net/bridge有些可以改的参数,但是似乎也不起效。 我希望这个bridge能够不管tag的ID,进来什么tag,解完后给iptables处理,然后出去还是什么tag。
有没有遇到同样问题的给个思路。
btw:系统是debian/etch,2.6.18的内核。
NetDC
[code]# vconfig
Expecting argc to be 3-5, inclusive. Was: 1
Usage: add [interface-name] [vlan_id]
rem [vlan-name]
set_flag [interface-name] [flag-num] [0 | 1]
set_egress_map [vlan-name] [skb_priority] [vlan_qos]
set_ingress_map [vlan-name] [skb_priority] [vlan_qos]
set_name_type [name-type]
# brctl
Usage: brctl [commands]
commands:
addbr <bridge> add bridge
delbr <bridge> delete bridge
addif <bridge> <device> add interface to bridge
delif <bridge> <device> delete interface from bridge
setageing <bridge> <time> set ageing time
setbridgeprio <bridge> <prio> set bridge priority
setfd <bridge> <time> set bridge forward delay
sethello <bridge> <time> set hello time
setmaxage <bridge> <time> set max message age
setpathcost <bridge> <port> <cost> set path cost
setportprio <bridge> <port> <prio> set port priority
show show a list of bridges
showmacs <bridge> show a list of mac addrs
showstp <bridge> show bridge stp info
stp <bridge> {on|off} turn stp on/off
[/code]
有看这两个命令的帮助,似乎没有关于tag透传的。
brctl应该是没有这个相关的,就vconfig了,仔细看了下,似乎应该是set_flag这个选项,但是当我执行
[code]# vconfig set_flag eth1 flag-num 1[/code]
却出现
[code]ERROR: trying to set flag on device -:eth1:- error: Invalid argument[/code]
platinum
[quote]原帖由 [i]ixp2xxx[/i] 于 2008-5-30 16:46 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6601343&ptid=1007360][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
我以前也遇到这个问题,但我记得把两个物理接口桥起来之后 ,vlan是可以透传的。而路由模式就比较困难了,自己把e1000的驱动修改了,模拟802.1Q数据包的发现可以在路由模式下透传。但没有实际应用。
有时间打个 ... [/quote]
为什么要在驱动里直接做呢?为什么不像 8021q.c 和 vlan.c 那样学习,注册一个协议,用那个协议去拆包组包呢?