[Cerowrt-devel] breaking off a port off the vlan correctly?
David Lang
david at lang.hm
Sat Jan 5 20:54:07 EST 2013
On Thu, 3 Jan 2013, Dave Taht wrote:
> One of the things I've long ignored, despite the popularity of it, is
> vlan stuff.
>
> I care, like everything else, it's just not currently a high priority
> for me to deal with high rate vlan traffic.
>
> But: I just had a need to connect two entirely separate networks
> together. Being me I just slammed a routed dreamplug between the two
> lans (which just worked five minutes after I compiled babeld and
> turned off getting default gateways from dhcp), but it seems saner to
> just remap one of the ports on a wndr3800 to be its own ethernet
> device (and keep hacking BQL onto the dreamplug, which is what I have
> it for)
>
> current config:
>
> default gw box <-> cerowrt <-> dreamplug <-> other network
>
> desired config:
>
> default gw box <-> cerowrt <-> dedicated port <-> other network
>
> However, in trying to do that, several ways, I made bricks.
I've used VLANs a bit on my 3700 and 3800 routers.
First thing is that the switch in these routers needs special handling to deal
with VLAN numbers >15, Depending on your build you may or may not have that
support compiled in.
To do this, you will want to have the eth0 interface configured to use VLANs, in
the default openwrt this is already the case with eth0.1 being defined.
define a new interface (eth0.2 for example)
Then configure the switch to put VLAN 2 on a particular port.
Unless you have a managed switch connected to that port, you want it to be
untagged on that port
As an example, here is the config of the 3800 I'm using right now
remember that the logical number of the switch ports is backwards from the
physical number (I like to use ports 1/4 on one vlan and 2/3 on a different one
so that I don't have to keep track)
Let me know if you need more help on this.
David Lang
/etc/config/networks
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.255.1'
option netmask '255.255.255.0'
option _orig_ifname 'wlan0 wlan1'
option _orig_bridge 'true'
option ifname 'eth0.1'
config switch
option name 'rtl8366s'
option reset '1'
option blinkrate '2'
option enable_vlan '1'
option enable_vlan4k '1'
config switch_vlan
option device 'rtl8366s'
option vlan '1'
option ports '0 2 3 5t'
config switch_port
option device 'rtl8366s'
option port '1'
option led '6'
config switch_port
option device 'rtl8366s'
option port '2'
option led '9'
config switch_port
option device 'rtl8366s'
option port '5'
option led '2'
config interface 'wan'
option proto 'dhcp'
option ifname 'eth1'
config interface 'wwan'
option proto 'dhcp'
config switch_vlan
option device 'rtl8366s'
option vlan '2'
option ports '1 5t'
config interface 'lan2'
option proto 'static'
option ifname 'eth0.2'
option ipaddr '192.168.254.1'
option netmask '255.255.255.0'
More information about the Cerowrt-devel
mailing list