Linux vlan桥不能正常工作

我尝试在Ubuntu 10.4上做vlan-bridge,因为我喜欢在每个vlan端口上运行ebtables。

我创build了一个脚本来简化这个工作:

$DEV ="lan.180" # vlan $VDEV ="brlan180" # vlan-bridge $IP ="192.168.10.1" $MASK ="255.255.255.0" ifconfig $DEV 0.0.0.0 brctl addbr $VDEV brctl addif $VDEV $DEV ifconfig $DEV 0.0.0.0 ifconfig $VDEV $IP netmask $MASK ifconfig $VDEV up 

我执行脚本后,brctl显示brigde

 bridge name bridge id STP enabled interfaces brlan180 8000.0026b9847*** no lan.180 

和dmesg显示的状态

 [356192.560351] vlan180: port 1(lan.180) entering learning state [356203.504216] vlan180: no IPv6 routers present [356207.537207] vlan180: port 1(lan.180) entering forwarding state 

但是,当我pingnetworking成员时,没有任何反应

 From 192.168.114.1 icmp_seq=1 Destination Host Unreachable From 192.168.114.1 icmp_seq=460 Destination Host Unreachable 

iptables接受所有的input,接受所有的转发,我在sysctl中得到net.ipv4.ip_forward = 1

  • 我错过了什么?
  • 应该vlan端口首先或先桥接?

你能否看到$ DEV是否真的起来了? 我不确定把桥接起来带来的成员。

 ifconfig $DEV up 0.0.0.0 

而不是ifconfig $ DEV 0.0.0.0

你确定vlan标签被networking接受吗? 它没有桥接工作吗?

此外,iptables和ip_forward是上面的层,桥接发生在第2层,所以它不应该影响桥接。