Wireless Bridge and DHCP client on TP-Link TL-WDR3600

I would like to use my TP-Link TL-WDR3600 v1 as a Wireless Bridge and bridge remote AP WANSrc_5 to its WAN interface

eth0.2 is the WAN port

The expectation is that:

a. plugging a cable into the WAN port or
b. having the router connect to WANSrc_5, bridges to WAN on this router

a is working but I am struggling to configure b and need help

/etc/config/network

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

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.20.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device
	option name 'eth0.2'
	option macaddr 'f8:1a:67:d0:90:f7'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'
	option type 'bridge'

config interface 'wan6'
	option device '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 '2 3 4 5 0t'

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

config device
	option type 'bridge'
	option name 'br-wan'
	list ports 'eth0.2'

/etc/config/wireless


config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel '1'
	option band '2g'
	option htmode 'HT20'
	option disabled '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option channel '36'
	option band '5g'
	option htmode 'HT20'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'W36_5'
	option encryption 'sae'
	option key 'Rooter2023!'

config wifi-iface 'wifinet2'
	option device 'radio1'
	option mode 'sta'
	option ssid 'WANSrc_5'
	option encryption 'psk2'
	option key 'rooter2017'
	option network 'wan'

/etc/config/dhcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option cachesize '1000'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'
	option filter_aaaa '0'
	option filter_a '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

/etc/config/firewall

config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
config rule
	option name		Allow-Ping
	option src		wan
	option proto		icmp
	option icmp_type	echo-request
	option family		ipv4
	option target		ACCEPT

config rule
	option name		Allow-IGMP
	option src		wan
	option proto		igmp
	option family		ipv4
	option target		ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-IPSec-ESP
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option name		Allow-ISAKMP
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT

Is your expectation that the devices that connect to the WDR3600 will be on the same L2 network as the upstream network (i.e. dumb AP / wifi extender), or do you want the WDR3600 to be a router -- thereby creating a different network for the downstream devices (which means that the upstream network will not be able to reach the devices connected to the 3600, providing a layer of security with NAT+firewall)?

1 Like

For a different project - not this thread :slight_smile:

Correct, and to be explicit, this access should be possible by plugging a cable into the WAN port as well - either action allows this router to provide WAN access to its subnet

ok... so this should be pretty simple...

remove the bridge line on the wan interface so that it looks like this:

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

Delete this:

Create a new wwan network interface:

config interface 'wwan'
	option proto 'dhcp'

add wwan to the list of covered networks in the wan firewall zone:

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	list   network		'wwan'
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

Then associate the wifi sta mode config stanza with wwan:

config wifi-iface 'wifinet2'
	option device 'radio1'
	option mode 'sta'
	option ssid 'WANSrc_5'
	option encryption 'psk2'
	option key 'rooter2017'
	option network 'wwan'

Reboot the router and it should work.

1 Like

Trying to understand:

The WANSrc_5 client bridges to wwan but I don't understand why we then dont bridge wwan and (wired) wan together into a br-wan?

Is it because that doesn't make sense or because that would be redundant as creating the wwan interface is enough to bridge the packets to the kernel and then we use iptables to route traffic to the WAN zone?

We don't want to bridge upstream networks together, as that could cause conflicts or problems for the upstream networks as well as issues with the wan connection should both be active at the same time. A bridge is bascially just a software defined unmanaged switch, putting both wan and wwan together in a bridge would be the equivalent of connecting them directly together -- they should always be independent.

Instead, we create a network interface for each physical interface, and then use those as WANs by associating them with the wan firewall zone.

Thank You for the solution. It works very nicely

  1. Under what situations should we consider using relayd?
  2. Has relayd been renamed recently or deprecated?

relayd is specifically for the purpose of creating "wifi extender" or a "wifi to ethernet" adapter when the devices on the repeater AP (or ethernet) need be on the same subnet as the upstream network. This makes a transparent bridge device with a wifi uplink (sta mode).

Not that I am aware of.

1 Like

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