VLAN's - R7000(Kong) + Unifi AP

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Thu Nov 23, 2017 23:17    Post subject: VLAN's - R7000(Kong) + Unifi AP Reply with quote
Been trying to get this to work for a couple days now. I must be missing something. I have DDWRT (kong asus r7000) on my router, wifi disabled. My wifi is all via 2 UniFi AP's. I currently have a kids/guest ssid and adult ssid. I want to have the kids/guest ssid go through opendns to restrict their content. No restriction on the adult ssid. I see how this can be done with dnsmasq options either vlan or different ip range.

1. Have one unifi ssid deliver dhcp to only that ssid (kids) - cant get unifi to only pull from that pool
2. Use vlan tagging, since this is available in both products, but ddwrt is cooperating here either.

How do I create a "virtual" vlan in ddwrt? In unifi, vlan tagging is just a drop-down option. So it would be vlan 3 for kids ssid.

dnsmasq config would be something like this. How to I bridge vlan3 to br1?

Code:
interface=br1
dhcp-option=br1,3,192.168.2.1
dhcp-option=br1,6,109.73.52.11,109.73.52.12
dhcp-range=br1,192.168.2.100,192.168.2.199,255.255.255.0,12h


Any ideas? Im open to other suggestions to. Maybe I just need to move the kids ssid directly to the router.[/code]
Sponsor
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Fri Nov 24, 2017 1:02    Post subject: Reply with quote
Set one of the lan ports to vlan3 by going to GUI VLANs page under Setup Tab. Say you want port 4 as vlan3, unselect vlan1 on port 4 and select vlan3 and apply settings. If you want to tag vlan3 with vlan1 just leave vlan1 checked and select Tagging and add vlan3 to it and apply settings.

Now go to the GUI Networking page (right by the VLANs page). On the Create Bridge press "Add" and enter "br1" (without quotes) in the empty name box and apply settings. Now go to the VLANs page a make sure port 4 is vlan3 and go back to the Networking page this will refresh the page so at the bottom you will see "Network Configuration br1". Enter IP Address 192.168.2.1 and in the Subnet Mask enter 255.255.255.0 and apply settings.

To refresh your Networking GUI screen goto VLANs page and back to the Networking Page. Now under "Assign to Bridge" select Add and under Assignment 0 select br1 and Interface select vlan3 and apply settings.

In the Networking Page under "Current Bridging Tables" you should see your br1 assigned to vlan3.

Your dnsmasq looks fine.

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Fri Nov 24, 2017 4:28    Post subject: Reply with quote
Just to make sure. This doesn't mean the unifi app's will have to be plugged in to port 4?
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Fri Nov 24, 2017 15:25    Post subject: Reply with quote
Just wanted to reply and say thanks! This worked. On the Vlan tab, I had to assign to all ports so the AP's would pick it up.
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Fri Nov 24, 2017 17:25    Post subject: Reply with quote
ok, maybe not, its wierd. Sometimes dhcp wont work.
Code:
default vlan (vlan 1) 192.168.0.x
vlan 3 192.168.2.x


only one is able to pull ip from dhcp, hardwired stuff in (vlan1) or static ip (vlan1) always work. but the vlan ssid's seem to be alternating which pulls an ip. They pull from the correct pool when they do get and ip.

There is no vlan tagging on vlan 1, so maybe I need to add that?
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Sat Nov 25, 2017 0:09    Post subject: Reply with quote
Do you have dhcp enabled on your APs? Conflict, don't know.
_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Tue Nov 28, 2017 1:15    Post subject: Reply with quote
Here is where I am.

Setup>VLAN
Checked Port 1 for VLAN 5

Setup>Networking
under "create bridge" > br5
under "assg to bridge" > "br5-vlan5" to interface "vlan5"
Code:
Current Bridging Table
Bridge Name   STP enabled   Interface
br0   no   vlan1
br5   no   vlan5


Network Configuration br5 - vlan5
Label > vlan5
Multicast forwarding > disable
masquerade /NAT > Enable
net isolation > disable
ip > 192.168.5.1
subnet > 255.255.255.0

Multiple DHCP Server
Code:

Interface br5 - vlan5: IP 192.168.5.1/255.255.255.0


Services>Add'l dnsmasq options is commented out for n
It will contain:
Code:

dhcp-option=br5,6,208.67.222.222,208.67.220.220


Looks like the clients are trying to get an ip. This just repeats, client never accepts the ip. I've tried multiple phones and laptops

Code:

Nov 27 19:46:14 lan daemon.info dnsmasq-dhcp[28179]: DHCPDISCOVER(br5) xx:xx:xx:xx:xx:xx
Nov 27 19:46:14 lan daemon.info dnsmasq-dhcp[28179]: DHCPOFFER(br5) 192.168.5.104 xx:xx:xx:xx:xx:xx


Even if I assign a static ip in the range it still doesnt have internet.

Code:

Chain POSTROUTING (policy ACCEPT 14731 packets, 1024K bytes)
 pkts bytes target     prot opt in     out     source               destination
 2233  208K SNAT       0    --  *      vlan2   192.168.0.0/24       0.0.0.0/0           to:x.x.x.x
    2   140 MASQUERADE  0    --  *      *       0.0.0.0/0            0.0.0.0/0           mark match 0x80000000/0x80000000
    0     0 SNAT       0    --  *      vlan2   192.168.5.0/24       0.0.0.0/0           to:x.x.x.x


I have tried with and without the iptables rules in various forums
Code:

iptables -t nat -I POSTROUTING -o br0 -j SNAT --to `nvram get lan_ipaddr`
iptables -t nat -I POSTROUTING -o 'get_wanface' -j SNAT --to 'nvram get wan_ipaddr'


All I am trying to do is force all people on a specific ssid (vlan5) to use specific DNS (opendns) servers. This is the kids ssid. I will probably add some bandwidth limiting and other limits once this is working. I also plan to force dns with iptables at some point.

Code:

iptables -t nat -I PREROUTING -i br5 -p udp --dport 53 -j DNAT --to 208.67.222.222
iptables -t nat -I PREROUTING -i br5 -p tcp --dport 53 -j DNAT --to 208.67.220.220


I do NOT want to block them from accessing servers on my main lan (192.168.0.x). That would be the next step if/when I make a guest ssid.
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Nov 28, 2017 4:03    Post subject: Reply with quote
After the Bridge is setup, I only use DNSMasq for seting up the network. I would clear out the Multiple DHCP Server Settings and ONLY use these setting in the DNSMasq Options...

interface=br5
# Set the DHCP range .100 to .200 and default lease time of 24 hours
dhcp-range=br5,191.168.5.100,192.168.5.200,255.255.255.0,24h
# Set the gateway
dhcp-option=br5,3,192.168.5.1
# Set DNS servers
dhcp-option=br5,6,208.67.222.222,208.67.220.220

In your Firewall...

# Force Network to OpenDNS
iptables -t nat -A PREROUTING -p udp -s 192.168.5.0/24 --dport 53 -j DNAT --to 208.67.222.222
iptables -t nat -A PREROUTING -p tcp -s 192.168.5.0/24 --dport 53 -j DNAT --to 208.67.222.222

This code is not needed....
iptables -t nat -I POSTROUTING -o br0 -j SNAT --to `nvram get lan_ipaddr`
iptables -t nat -I POSTROUTING -o 'get_wanface' -j SNAT --to 'nvram get wan_ipaddr'

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Tue Nov 28, 2017 13:42    Post subject: Reply with quote
thanks, but no luck. Restored a backup (from before any vlan stuff), rebooted, still cant successfully get an ip, and testing static, such as 192.168.5.100 dont have internet.

This is all from the same mac address
Code:

Nov 28 08:36:23 lan daemon.info dnsmasq-dhcp[10465]: DHCPDISCOVER(br5) xx:xx:xx:xx:xx:xx
Nov 28 08:36:23 lan daemon.info dnsmasq-dhcp[10465]: DHCPOFFER(br5) 192.168.5.164 xx:xx:xx:xx:xx:xx
Nov 28 08:36:25 lan daemon.info dnsmasq-dhcp[10465]: DHCPDISCOVER(br5) xx:xx:xx:xx:xx:xx
Nov 28 08:36:25 lan daemon.info dnsmasq-dhcp[10465]: DHCPOFFER(br5) 192.168.5.164 xx:xx:xx:xx:xx:xx
Nov 28 08:36:27 lan daemon.info dnsmasq-dhcp[10465]: DHCPDISCOVER(br5) xx:xx:xx:xx:xx:xx
Nov 28 08:36:27 lan daemon.info dnsmasq-dhcp[10465]: DHCPOFFER(br5) 192.168.5.164 xx:xx:xx:xx:xx:xx
Nov 28 08:36:31 lan daemon.warn dnsmasq[10465]: Maximum number of concurrent DNS queries reached (max: 150)
[/code]
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Nov 28, 2017 16:14    Post subject: Reply with quote
Ooooops, I had a typo in the above code, 191 should be 192 this will cause DHCP to not work on br5.

Correction...
# Set the DHCP range .100 to .200 and default lease time of 24 hours
dhcp-range=br5,192.168.5.100,192.168.5.200,255.255.255.0,24h

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Tue Nov 28, 2017 16:34    Post subject: Reply with quote
I did catch that typo.
Here is my dnsmasq

Code:
# Select inteface br5
interface=br5
# Set the DHCP range .100 to .200 and default lease time of 24 hours
dhcp-range=br5,192.168.5.100,192.168.5.200,255.255.255.0,24h
# Set the gateway
dhcp-option=br5,3,192.168.5.1
# Set DNS servers
dhcp-option=br5,6,208.67.222.222,208.67.220.220


Other dnsmasq option (in case it helps)
Encrypt DNS > Enble
Cache DNSSEC data > Disable
Validate DNS Replies (DNSSEC) > Disable
Check unsigned DNS replies > Disable
Local DNS > Enable
No DNS Rebind > Enable
Query DNS in Strict Order > Enable
Add Requestor MAC to DNS Query > Disable

SPI Firewall is on (with the following checked)
ARP Spoofing Protection
Block Anonymous WAN Requests (ping)
Filter Multicast
Filter IDENT (Port 113)
Block WAN SNMP access
Limit SSH Access
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Nov 28, 2017 17:56    Post subject: Reply with quote
For the DNSMasq Settings try these settings to test out...

Encrypt DNS > Disabled
Cache DNSSEC data > Disable
Validate DNS Replies (DNSSEC) > Disable
Check unsigned DNS replies > Disable
Local DNS > Disable
No DNS Rebind > Disable
Query DNS in Strict Order > Disable
Add Requestor MAC to DNS Query > Disable

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Tue Nov 28, 2017 18:42    Post subject: Reply with quote
Sad no luck with those changes
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Nov 28, 2017 18:54    Post subject: Reply with quote
Can you test an ethernet device on the R7000 that has port setup as untagged vlan5 only? Make sure your ethernet device is setup for DHCP too.
_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
GigaGuy
DD-WRT Novice


Joined: 29 Jul 2011
Posts: 16

PostPosted: Tue Nov 28, 2017 19:17    Post subject: Reply with quote
Here is my VLAN page.


If I understood what you asked. I plugged laptop (DHCP) into Port 1 (which turned green when I did it). It pulled a 192.168.0.x ip

Seems it should pulled a 192.168.5.x
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum