Nanopi R4S (4G) router + WNDR3700v4 AP/Switch + VLANs

I am upgrading my main router from a Netgear R7800 to R4S and I can't seem to get a working VLANs setup. I am testing my setup with the below hardware, the reason I am using the WNDR3700v4 instead of R7800 is to test the new configuration without taking down the Internet connection to the house.

  • R4S (4G) as main router (replace the R7800 with NSS)
  • Netgear WNDR3700v4 as WiFi AP and switch with VLANs

Essentially, I am replicating the setup in this tread but without the 6 port switch. Instead I want to use the switch on the WNDR3700v4 (R7800 when I get the setup working).

Based on the above thread, it seems possible to do with a 6 port switch. Is it also possible without the extra switch, instead use the onboard switch on the AP?

I tried the following setup with VLANs (br-lan.11 for LAN and br-lan.31 for Guest) and 2 interface on the R4S, I can get an IP address on my laptop from the DHCP server listening on br-lan.11 on the R4S when the laptop was connected to the LAN port. I also setup another DHCP instance listening on br-lan.31 for the Guest network/subnet. However, I can't seem to be able to test the guest DHCP server directly with my laptop without a switch.

So, I setup a bridge (br on eth0.2) on the AP and Enable VLAN Filtering for VLAN ID 11 and 31. I also setup 2 interface on the AP, br.11 for LAN and br.31 for Guest, br.11 (LAN) interface can get an IP from the DHCP server, but not br.31 (Guest).

Any ideas/suggestions how I can get the setup to work?

Did you already set the DHCP forwarding to VLANs rule?

Below is what I have for the Guest network on the R4S. I don't have firewall enabled on the 3700v4.

The good news is I can get a LAN IP on the br.11 subnet on my laptop when connected to one of the switch port I setup on VLAN ID 11 on the 3700v4 AP. So we know the communication between the 3700v4 and the R4S is working for LAN. Now I just need to figure out why VLAN ID 31 (br.31 guest network) is not working over the bridge.

Br11 is your default/mgmt VLAN from what I understood, did you setup correctly the trunk to your AP?

I need some config to understand your setup…

I have limited knowledge on VLAN and networking... so I am not sure if I setup the trunk correctly. I have been experimenting with different settings by tagging/untagging the ports, but that doesn't seem to help. I did saw in the DHCP server log that an IP in the correct subnet was assigned to the MAC of tguest interface, it's just that the packets were never made it back to the AP.

Fri Jan 18 01:28:58 2013 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan.31) XXXXXX
Fri Jan 18 01:28:58 2013 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan.31) 192.168.31.238 XXXXXX

Network config for R4S:

...
config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'

config device
        option name 'eth1'
        option macaddr 'XXXXXX'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option delegate '0'
        option device 'br-lan.11'

config device
        option name 'eth0'
        option macaddr 'XXXXXX'

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'
        option hostname '*'
        option delegate '0'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'

config bridge-vlan
        option device 'br-lan'
        list ports 'eth1'
        option vlan '11'

config bridge-vlan
        option device 'br-lan'
        option vlan '31'
        list ports 'eth1:t'

config device
        option name 'br-lan.1'
        option type '8021q'
        option ifname 'br-lan'
        option vid '1'
        option acceptlocal '1'

config interface 'guest'
        option proto 'static'
        option device 'br-lan.31'
        option ipaddr '192.168.31.1'
        option netmask '255.255.255.0'
        option defaultroute '0'
        option delegate '0'

config device
        option name 'br-lan.31'
        option type '8021q'
        option ifname 'br-lan'
        option vid '31'
        option acceptlocal '1'

config device
        option name 'br-lan.11'
        option type '8021q'
        option ifname 'br-lan'
        option vid '11'
        option acceptlocal '1'

Network config on AP:

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0t'
        option description 'default'

config device
        option name 'eth0'
        option ipv6 '0'
...
config device
        option type '8021q'
        option ifname 'eth0'
        option vid '2'
        option name 'eth0.2'

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

config switch_vlan
        option device 'switch0'
        option vlan '31'
        option vid '31'
        option description 'test_guest'
        option ports '0t 1 5t'

config switch_vlan
        option device 'switch0'
        option vlan '11'
        option vid '11'
        option description 'test_lan'
        option ports '0t 2'

config device
        option type 'bridge'
        option name 'br'
        list ports 'eth0.2'
        list ports 'eth0.11'
        list ports 'eth0.31'

config bridge-vlan
        option device 'br'
        option vlan '31'
        list ports 'eth0.2:t'
        list ports 'eth0.31:t'

config bridge-vlan
        option device 'br'
        option vlan '11'
        list ports 'eth0.2'
        list ports 'eth0.11'

config interface 'tguest'
        option proto 'dhcp'
        option hostname '*'
        option defaultroute '0'
        option peerdns '0'
        option delegate '0'
        option device 'br-tguest'

config interface 'tlan'
        option proto 'dhcp'
        option hostname '*'
        option defaultroute '0'
        option peerdns '0'
        option delegate '0'
        option device 'br-tlan'

config device
        option type 'bridge'
        option name 'br-tguest'
        option bridge_empty '1'
        list ports 'br.31'
        list ports 'eth0.31'
        option acceptlocal '1'

config device
        option type 'bridge'
        option name 'br-tlan'
        list ports 'br.11'
        list ports 'eth0.11'
        option bridge_empty '1'
        option acceptlocal '1'

On the router...

If VLAN 11 is supposed to be untagged on eth1, make it explicit by adding :u*

config bridge-vlan
        option device 'br-lan'
        list ports 'eth1:u*'
        option vlan '11'

remove this:

Remove the last 2 lines in the guest interface definition:

Delete these

Also, your guest network does not appear to be assigned to a firewall zone... For now, assign it to the lan zone (you can tighten it up later).

On the AP.... There is a lot wrong here... I'd recommend resetting it to defaults and starting over. Post the config from the default configuration and state the purpose of each port (i.e. which is the trunk port that goes to the main router, and for the other ports, what VLAN(s) should be assigned on each).

Updated Router/R4S config based on your suggestions.

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

config globals 'globals'
        option packet_steering '1'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'

config device
        option name 'eth1'
        option macaddr 'XXXXXXX'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option delegate '0'
        option device 'br-lan.11'

config device
        option name 'eth0'
        option macaddr 'XXXXXX'

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'
        option hostname '*'
        option delegate '0'

config bridge-vlan
        option device 'br-lan'
        list ports 'eth1:u*'
        option vlan '11'

config bridge-vlan
        option device 'br-lan'
        option vlan '31'
        list ports 'eth1:t'

config interface 'guest'
        option proto 'static'
        option device 'br-lan.31'
        option ipaddr '192.168.31.1'
        option netmask '255.255.255.0'

AP reset to default, clean up and created 2 VLANs

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

config globals 'globals'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.11'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option delegate '0'
        option ipaddr '192.168.1.10'

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

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '11'
        option description 'lan'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option vid '31'
        option description 'guest'
        option ports '0t 1'

config device
        option name 'eth0'
        option ipv6 '0'

On the AP, I would like LAN 1, 2 and 3 to be assigned to VLAN ID 11 and LAN 4 to be assigned to VLAN ID 31 (guest). I also want to create a br-guest interface on VLAN 31 on the AP so that guest WiFi clients can obtain DHCP IP from the DHCP server running on the R4S router.

Remove the delegate option from both lan and wan interfaces on the main router.

On the AP...

For VLAN 31, change it so that it looks like this (add 5t)

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option vid '31'
        option description 'guest'
        option ports '0t 1 5t'

Then create a bridge and an unmanaged interface for the guest network like this:

config device
        option name 'br-guest'
        option type 'bridge'
        list ports 'eth0.31'

config interface 'guest'
        option device 'br-guest'
        option proto 'none'

Finally, you can then link SSIDs to the networks (this happens in the wireless file, not the network file), and you should have wifi and wired as desired.

Thank you @giuliomagnifico @psherman for all your help. I think the missing 5t for VLAN 31 was the key to the problem.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.