TL-WDR3600v1/WR1043NDv1-2xWLAN/LAN-VLAN Tags

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2
Author Message
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sat Sep 28, 2019 7:27    Post subject: Reply with quote
Everything looks correct. Does the Pfsense have a configuration that match?
Sponsor
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Mon Sep 30, 2019 12:09    Post subject: Reply with quote
Per Yngve Berg wrote:
Everything looks correct. Does the Pfsense have a configuration that match?


I managed to track it down to ngix on the pfsense box. i setup wpad on the two lan segments, but it only passed "DIRECT" as a proxy. Even though the vlan dhcp wasn't configured to use wpad, it was throwing up an authorization error. Once i added all the vlan segments to the ngix conf, it fired up.

I got it working with the following config. For some reason, it didn't like have vlan3 config on vlan1.

swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 vlan 1 set ports "0t 1 5"

swconfig dev switch0 set enable_vlan 2
swconfig dev switch0 vlan 2 set ports "0t 1t"

swconfig dev switch0 set enable_vlan 3
swconfig dev switch0 vlan 3 set ports "0t 1t 2 3 4"
swconfig dev switch0 vlan 3 set vid "27"

swconfig dev switch0 port 2 set vlan_prio "4"
swconfig dev switch0 port 3 set vlan_prio "4"
swconfig dev switch0 port 4 set vlan_prio "4"
swconfig dev switch0 port 5 set vlan_prio "4"

swconfig dev switch0 set apply

vconfig set_name_type DEV_PLUS_VID_NO_PAD
vconfig add eth0 3
ifconfig vlan3 192.168.27.10 netmask 255.255.255.0
ifconfig vlan 3 up

lan and vlan are both working with dnsmasq relaying DHCP from pfsense.
so both port 5 and 2-4 obtain correct IP and can browse internet, etc.

I have one remaining issue, before i start the wifi
The dd-wrt host does not see the dns, so the box doesn't receive ntp and can't do lookups from the console.
i tried adding the settings to dnsmasq for vlan2 but it is not used.
The issue seems to be the resolv.conf nameserver is pointing to itself rather than the pfsense box, which i need.

do you have the answer for me pls.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Mon Sep 30, 2019 19:21    Post subject: Reply with quote
swconfig dev switch0 set enable_vlan 2

There is only two possible values here.

0=disable
1=enable

It enables vlan support on the switch. You will only need this once.
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Mon Sep 30, 2019 19:33    Post subject: Reply with quote
Per Yngve Berg wrote:
swconfig dev switch0 set enable_vlan 2

There is only two possible values here.

0=disable
1=enable

It enables vlan support on the switch. You will only need this once.


ok. thx. do you know why,

resolv.conf = dd-wrt
resolv.dnsmasq = pfsense

dd-wrt host seems to be using resolv.conf.
if i overwrite resolv.conf from the console,
then dns resolve starts working
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Wed Oct 02, 2019 16:20    Post subject: Reply with quote
Have you ticked the "Use DNSMasq for DNS"?
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Thu Oct 03, 2019 16:13    Post subject: Reply with quote
I hope this helps someone else, it took me ages to get this working.
I have the 4 switch ports on a separate VLAN, and created two WAPs for home and guests.
The unit acts as a WAP/Switch connected to pfsense supplying (routing/dns/dhcp/firewall)


Startup Script
Code:
# enable vlan support
swconfig dev switch0 set enable_vlan 1
# set 8.02q port priorities for video streaming
swconfig dev switch0 port 2 set vlan_prio "4"
swconfig dev switch0 port 3 set vlan_prio "4"
swconfig dev switch0 port 4 set vlan_prio "4"
swconfig dev switch0 port 5 set vlan_prio "4"
# assign switch ports to VLAN27
swconfig dev switch0 vlan 1 set ports "0t 1t 2 3 4 5"
swconfig dev switch0 vlan 1 set vid "27"
# retain specific ports on LAN
swconfig dev switch0 vlan 2 set ports "0t 1"
swconfig dev switch0 vlan 2 set vid "1"
# create VLAN41 WLAN
swconfig dev switch0 vlan 4 set ports "0t 1t"
swconfig dev switch0 vlan 4 set vid "41"
# create VLAN51 WLAN-GUEST
swconfig dev switch0 vlan 5 set ports "0t 1t"
swconfig dev switch0 vlan 5 set vid "51"
swconfig dev switch0 set apply


Firewall Script
Code:
# Restrict VLANs from accessing br0's subnet but pass traffic through br0 to the internet
iptables -I FORWARD -i vlan1 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -I FORWARD -i br1 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -I FORWARD -i br2 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP

# Pass VLAN27 (switch ports) to WAN Port
iptables -I FORWARD -i vlan1 -o vlan2 -j ACCEPT
iptables -I FORWARD -i vlan2 -o vlan1 -j ACCEPT

# Allow VLAN27 to pass DHCP / DNS on the router
iptables -I INPUT -i vlan1 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i vlan1 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i vlan1 -p tcp --dport 53 -j ACCEPT

# Pass VLAN41 (WLAN) to WAN Port
iptables -I FORWARD -i br1 -o vlan2 -j ACCEPT
iptables -I FORWARD -i vlan2 -o br1 -j ACCEPT

# Allow VLAN41 (WLAN) to pass DHCP / DNS on the router
iptables -I INPUT -i br1 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br1 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br1 -p tcp --dport 53 -j ACCEPT

# Pass VLAN51 (WLAN GUEST) to WAN Port
iptables -I FORWARD -i br2 -o vlan2 -j ACCEPT
iptables -I FORWARD -i vlan2 -o br2 -j ACCEPT

# Allow VLAN51 (WLAN GUEST) to pass DHCP / DNS on the router
iptables -I INPUT -i br2 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br2 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br2 -p tcp --dport 53 -j ACCEPT


Basic Setup
WAN Connection - Disabled
Shortcut forwarding - disable
STP enable

Local IP (address of dd-wrt device)
Gateway/DNS (address of pfsense)
WAN Port - assign WAN port to switch
DHCP Server - disabled
Use DNSMasq for DNS
Forced DNS Redirection
Time Server - pfsense device

Advanced Routing
operating mode - Router

Switch Config
** don't touch anything **

Networking

VLAN Tagging
VLAN 0 eth0 Tag Number 51 ** my guest wifi vlan
VLAN 1 eth0 Tag Number 41 ** my home wifi vlan

Create Bridge
br0 STP off IGMP Off
br1 STP off IGMP On
br2 STP off IGMP On

** you need to create, save and apply (a couple of times to create and save the config)

Assign Bridge
br1 - ath0 (2G wifi)
br1 - ath1 (5g wifi)
br1 - eth0.41
br2 - ath0.1 (2G wifi)
br2 - ath1.1 (5g wifi)
br2 - eth0.51

** save and apply the bridge assignments - as above, sometimes couple of times needed.
reboot to get the eth0.41 and eth0.51 visible

Port Setup
WAN Port - Vlan2
eth0, eth0.41, eth0.51, vlan1, vlan2, ath0, ath0.1, ath1, ath1.1 - leave bridge as Default

br1
leave multicast/isolation/force dns as disabled
add ip of dd-wrt you want for home wlan

br2
leave multicast/isolation/force dns as disabled
add ip of dd-wrt you want for guest wlan

Services - Dnsmasq

dnsmasq - enable
all others - disable

additional dnsmasq options
# set DNS server to pfsense
dhcp-option=br0,6,192.168.21.5

# Enables DHCP and forward to pfsense
interface=br1
dhcp-relay=192.168.41.10,192.168.41.5,br1

# Enables DHCP and forward to pfsense
interface=br2
dhcp-relay=192.168.51.10,192.168.51.5,br2

wan traffic - disable

i recommend to do a factory reset and nvram erase, to ensure you have clean nvram.
I found the unit to be very sensitive to changes i.e. saving one thing, screwed with something else.
also, there was a lot of junk still in nvram after experiementing with the tagging, bridges, etc.
even these were deleted, there was still junk in nvram.

very important not to touch anything on the switch config tab as it directly interferes with the startup settings.

Thanks Per Yngve Berg your input and guidance.
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Sun Oct 06, 2019 13:25    Post subject: Reply with quote
trying to repeat the exercise on a wr-1043nd v1. not having much luck.
- have separated wifi into separate nets.
- dd-wrt box resolves dns and can connect over internet via lan address. but clients can't
-
there is no vid value. and filters doesn't seem to direct traffic via vlan2

help appreciated
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Sun Oct 06, 2019 17:06    Post subject: Reply with quote
It has a Switch: Realtek RTL8366RB

https://wikidevi.com/wiki/TP-LINK_TL-WR1043ND_v1.x

Can't help you, as it's not Atheros.
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Sun Oct 06, 2019 19:45    Post subject: Reply with quote
Here is my config for TL-WR1043ND v1. My box has Atheros AR9132 rev 2 (0xb9).
Here is the config i used to get it working.

Startup Script

Code:
# enable vlan support
swconfig dev switch0 set enable_vlan 1
swconfig dev switch0 set enable_vlan4k 1
# retain cascade connection
swconfig dev switch0 vlan 1 set ports "0 1 5t"
# assign switch ports to VLAN27
swconfig dev switch0 vlan 27 set ports "0t 2 3 4 5t"
# create VLAN41 WLAN
swconfig dev switch0 vlan 41 set ports "0t 5t"
# create VLAN51 WLAN-GUEST
swconfig dev switch0 vlan 51 set ports "0t 5t"
swconfig dev switch0 set apply

vconfig set_name_type DEV_PLUS_VID_NO_PAD
vconfig add eth0 27
ifconfig eth0.27 192.168.27.11 netmask 255.255.255.0
ifconfig eth0.27 up



Firewall Script

# Restrict VLANs from accessing br0's subnet but pass traffic through br0 to the internet
iptables -I FORWARD -i br0 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -I FORWARD -i br1 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -I FORWARD -i br2 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP

# Pass VLAN27 (switch ports) to WAN Port
iptables -I FORWARD -i br0 -o vlan2 -j ACCEPT
iptables -I FORWARD -i vlan2 -o br0 -j ACCEPT

# Allow VLAN27 to pass DHCP / DNS on the router
iptables -I INPUT -i br0 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br0 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br0 -p tcp --dport 53 -j ACCEPT

# Pass VLAN41 (WLAN) to WAN Port
iptables -I FORWARD -i br1 -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o br1 -j ACCEPT

# Allow VLAN41 (WLAN) to pass DHCP / DNS on the router
iptables -I INPUT -i br1 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br1 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br1 -p tcp --dport 53 -j ACCEPT

# Pass VLAN51 (WLAN) to WAN Port
iptables -I FORWARD -i br2 -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o br2 -j ACCEPT

# Allow VLAN51 (WLAN GUEST) to pass DHCP / DNS on the router
iptables -I INPUT -i br2 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br2 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br2 -p tcp --dport 53 -j ACCEPT


Basic Setup
WAN Connection - Disabled
Shortcut forwarding - disable
STP enable

Local IP (address of dd-wrt device)
Gateway/DNS (address of pfsense)
WAN Port - assign WAN port to switch
DHCP Server - disabled
Use DNSMasq for DNS
Forced DNS Redirection
Time Server - pfsense device

Advanced Routing
operating mode - Router

Networking

VLAN Tagging
VLAN 0 eth0 Tag Number 51 ** my guest wifi vlan
VLAN 1 eth0 Tag Number 41 ** my home wifi vlan

Create Bridge
br0 STP off IGMP Off
br1 STP off IGMP On
br2 STP off IGMP On

** you need to create, save and apply (a couple of times to create and save the config)

Assign Bridge
br1 - ath0 (2G wifi)
br1 - eth0.41
br2 - ath0.1 (2G wifi)
br2 - eth0.51

** save and apply the bridge assignments - as above, sometimes couple of times needed.
reboot to get the eth0.41 and eth0.51 visible

Port Setup
WAN Port - Vlan2
eth0, eth0.41, eth0.51, vlan1, vlan2, ath0, ath0.1, ath1, ath1.1 - leave bridge as Default

br1
leave multicast/isolation/force dns as disabled
add ip of dd-wrt you want for home wlan

br2
leave multicast/isolation/force dns as disabled
add ip of dd-wrt you want for guest wlan

Services - Dnsmasq

dnsmasq - enable
all others - disable

additional dnsmasq options
# set DNS server to pfsense
dhcp-option=br0,6,192.168.21.5

# Enables DHCP and forward to pfsense
interface=eth0.27
dhcp-relay=192.168.27.11,192.168.27.5,eth0.27

# Enables DHCP and forward to pfsense
interface=br1
dhcp-relay=192.168.41.11,192.168.41.5,br1

# Enables DHCP and forward to pfsense
interface=br2
dhcp-relay=192.168.51.11,192.168.51.5,br2
gwaitsi
DD-WRT User


Joined: 11 Jan 2007
Posts: 79

PostPosted: Tue Oct 08, 2019 21:21    Post subject: Reply with quote
not so perfect yet. Each one works independently, but when i want to connect the wan port of the wdr3600 to the lan port of the wr1034nd. (or vis-versa) the downstream unit wifi (vlan41 and 51) don't work.

The LAN and VLAN27 do work on both devices.

so seems something to do with the downstream bridge.

Any ideas?
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum