Understanding switches, vlans and interfaces on my R7500v1?

I recently bought an used Netgear R7500v1 and installed OpenWRT on it, and I've managed to make it function as a dumb AP.

However, I don't quite understand the VLAN/switch/interface setup, maybe someone could guide me here?

My ultimate goal is to have a trunk (with tagged VLAN traffic from another switch) coming in at the current WAN port, and then assign the WLAN to one VLAN and the switched ports to another. I'd like to have my wired clients on one network and the wireless on another. I have a pfsense based firewall doing dhcp, handling vlans etc, and a managed switch between the firewall and my OpenWRT router.

This is from a ssh session:

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fddb:xxxx:xxxx::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 0t'

Which interface is which?

lots of resources here and on the wiki... ( use search... wlan on it's own vlan is a separate thing to tackle... simple enough... but not when mixed in on a first attempt ) i'd suggest not using the wan port... at least till you've mastered the basics... having the managed switch will make it alot easier for you to test... i'd also recommend using luci for the vlan/switch config to begin with.

Hi,

Thanks for your reply, but I should probably rephrase my question a bit.

Why is my router setup with several VLANs like this? My WAN is eth0.2, why not just eth0 if the WAN port is a dedicated interface, and why is my LAN bridge on a VLAN of it's own?

I've done some happy experimenting with VLANs on my home network before, but I just don't understand the current setup.

Your device has one internal interface for each external port, you do not have to use VLANs if you do not need them.

1 Like

So I'm not the "guide" your looking for nor can I answer your question about why the interfaces are set up the way they are.

Assuming your still reading this reply after those disclaimers... and reading into your question about eth0.2 - you can re-purpose "eth0.2" if you like.

On my r7500v2, eth0.2 was originally mapped to WAN when it was configured as a GW/AP.

I now have the device set up as a "dumb" AP with two tagged VLAN's comming in on the WAN port (aka "trunk"). One VLAN (id 2) is bridged for a guest wifi network (both 2.4 and 5 GHz) and the other VLAN (id 3) is my "home" network (bridged to the lan ports and also both wifi radios).

The import thing I had do to get this working was to tag both VLAN's on trunk. I originally followed the wiki "instructions" which implied only one VLAN is required to be tagged - there is plenty of advice saying tag all VLAN's so I eventually figured it out.

I know what I have is a bit different than your objective, but in case it helps here are a few excerpts from my /etc/config/network (the ipaddr fields are anonymized)

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1.1 eth0.3'
        option proto 'static'
        option ipaddr 'XXX.XXX.XXX.XXX'
        option netmask '255.255.255.0'
        option gateway 'XXX.XXX.XXX.XXX'
        option dns XXX.XXX.XXX.XXX

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 1 2 3 4 5t 6'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0t 5t'

config interface 'guestWLAN'
        option ifname 'guestWLAN'
        option ifname 'eth0.2'
        option proto 'static'
        option ipaddr 'XXX.XXX.XXX.XXX'
        option netmask '255.255.255.0'
        option type 'bridge'

FWIW, i also subnet a ipv6 60 with a separate 64 on on guestWLAN and lan - seems to work well for me.

EDIT 0: I also have an option dns XXX.XXX.XXX.XXX entry under lan interface config but I forgot why I have it. I might have done it just for troubleshooting or it might be helpful to get opkg update working.

EDIT 1: ug, I really shouldn't have responded as this is my first attempt at vlans and I did the minimum to get it working w/o taking the time to really understand everything. In the "config switch" section I did actually have '3' for the reset and enable_vlan options - this worked but I think is wrong and misleading. After rereading the documentation which indicated that these options can be either '0' (disabled) or '1' (enabled) I changed these to '1' and so far everything still works. i.e. '3' is meaningless (and wrong) in the "config switch" section. Sorry for the noise and any confusion this may have caused.

HTH

Thanks, I think this should be very useful for me. I'll look into it when I have more time!

And thanks everyone for replying, it's really appreciated!