DHCP not working on TP-Link RE200 repeater

Hi!

I'm trying to replace my trusty tp-link wa850re with a tp-link re200, courtesy to this new port: Port to TP-Link RE200 (thanks guys!)

The wa850re (running OpenWrt 18.06-SNAPSHOT, r7827-b7e7d220e7) is set up as a wifi repeater with relayd, and I'm trying to do the same on the re200 (running OpenWrt SNAPSHOT, r12040-8df14c229c), following the wiki entry for relay configuration and using the wa850re config as a template.

The wifi part seems to work fine (repeater connects as client to main router and creates its own wifi, my laptop can connect to repeater wifi) - but dhcp4 doesn't work. If I set a static IP address on my laptop and connect to the repeater wifi, it can access the internet fine. But, obviously, I need dhcp working.

I've tried disabling the firewall but that doesn't solve the problem.

One weird thing I've noticed:
On the old (working) repeater, the mac addresses on wlan0 and br-lan are different while the macs on wlan0 and wlan0-1 (repeater client and ap wifis) are the same.
On the new (buggy) repeater, wlan1 and br-lan have the same mac, and wlan1 and wlan1-1 have different macs.

On the relayd wiki page, there's this note:

The most common problem is that the client router cannot pass the DHCP message between the main router and the client connected to the client router. Currently it seems to be the hardware/SOC limitation (related to MAC cloning?) 

I'm not sure that's the problem (after all the device is meant to be used as a repeater), but of course it could be.

Has anyone else got the re200 running as a repeater? If so: how did you get it working / set it up?

Debug info below:

Here's the NetworkManager log on the laptop:

2020-02-04T10:05:09.384885+00:00 laptop NetworkManager[2003]: <info>  [1580807109.3847] device (wlp6s0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "MyWifi_Ext"
2020-02-04T10:05:09.384951+00:00 laptop NetworkManager[2003]: <info>  [1580807109.3848] device (p2p-dev-wlp6s0): supplicant management interface state: 4-way handshake -> completed
2020-02-04T10:05:09.400662+00:00 laptop NetworkManager[2003]: <info>  [1580807109.4005] device (wlp6s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
2020-02-04T10:05:09.401111+00:00 laptop NetworkManager[2003]: <info>  [1580807109.4010] dhcp4 (wlp6s0): activation: beginning transaction (timeout in 45 seconds)
2020-02-04T10:05:11.838959+00:00 laptop NetworkManager[2003]: <info>  [1580807111.8385] dhcp6 (wlp6s0): activation: beginning transaction (timeout in 45 seconds)
2020-02-04T10:05:11.844208+00:00 laptop NetworkManager[2003]: <info>  [1580807111.8440] dhcp6 (wlp6s0): option dhcp6_name_servers   => 'fd23:5d23:cd23::1'
2020-02-04T10:05:11.844370+00:00 laptop NetworkManager[2003]: <info>  [1580807111.8440] dhcp6 (wlp6s0): option ip6_address          => 'fd23:5d23:cd23::2a8'
2020-02-04T10:05:11.844524+00:00 laptop NetworkManager[2003]: <info>  [1580807111.8441] dhcp6 (wlp6s0): state changed unknown -> bound
2020-02-04T10:05:13.235064+00:00 laptop NetworkManager[2003]: <info>  [1580807113.2341] device (wlp6s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
2020-02-04T10:05:13.239234+00:00 laptop NetworkManager[2003]: <info>  [1580807113.2390] device (wlp6s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
2020-02-04T10:05:13.240258+00:00 laptop NetworkManager[2003]: <info>  [1580807113.2400] device (wlp6s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
2020-02-04T10:05:13.241835+00:00 laptop NetworkManager[2003]: <info>  [1580807113.2416] manager: NetworkManager state is now CONNECTED_LOCAL
2020-02-04T10:05:13.399986+00:00 laptop NetworkManager[3270]: nisdomainname: you must be root to change the domain name
2020-02-04T10:05:13.400050+00:00 laptop NetworkManager[3270]: nisdomainname: you must be root to change the domain name
2020-02-04T10:05:13.403770+00:00 laptop NetworkManager[2003]: <info>  [1580807113.4036] device (wlp6s0): Activation: successful, device activated.
2020-02-04T10:05:54.833409+00:00 laptop NetworkManager[2003]: <warn>  [1580807154.8324] dhcp4 (wlp6s0): request timed out
2020-02-04T10:05:54.833657+00:00 laptop NetworkManager[2003]: <info>  [1580807154.8325] dhcp4 (wlp6s0): state changed unknown -> timeout

The main router (OpenWrt 18.06.1, r7258-5eb055306f) seems to get the dchp requests from the laptop, at least in the router's log I can see:

Tue Feb  4 10:54:43 2020 daemon.info dnsmasq-dhcp[5559]: DHCPDISCOVER(br-lan) 11:22:33:44:55:66
Tue Feb  4 10:54:43 2020 daemon.info dnsmasq-dhcp[5559]: DHCPOFFER(br-lan) 10.0.42.56 11:22:33:44:55:66

Config of the re200 repeater:

/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 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'

config dhcp 'lan'
    option interface 'lan'
    option ignore '1'
    option ra 'relay'
    option ndp 'relay'
    option dhcpv6 'relay'
    option start '100'
    option limit '150'
    option leasetime '12h'

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/wireless:

config wifi-device 'radio1'
    option type 'mac80211'
    option channel '3'
    option hwmode '11g'
    option path 'platform/10180000.wmac'
    option htmode 'HT20'
    option disabled '0'

config wifi-iface 'wifinet1'
    option ssid 'MyWifi'
    option device 'radio1'
    option mode 'sta'
    option key 'thekey'
    option network 'wwan'
    option encryption 'psk2'

config wifi-iface 'wifinet2'
    option network 'lan'
    option ssid 'MyWifi_Ext'
    option encryption 'psk2'
    option device 'radio1'
    option mode 'ap'
    option key 'theykey'

/etc/config/network:

config interface 'lan'
    option ifname 'eth0'
    option type 'bridge'
    option proto 'static'
    option netmask '255.255.255.0'
    option ipaddr '10.0.6.1'
    option gateway '10.0.42.1'
    option dns '10.0.42.1'
    option ip6assign '60'

config interface 'wwan'
    option proto 'dhcp'

config interface 'repeater'
    option proto 'relay'
    list network 'lan'
    list network 'wwan'
    option ipaddr '10.0.42.6'

Installing tcpdump on the re200 repeater and looking at dhcp requests shows this:

tcpdump -i wlan1 "port bootps"
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan1, link-type EN10MB (Ethernet), capture size 262144 bytes
10:58:45.834840 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 66:55:44:33:22:11 (oui Unknown), length 300
10:58:47.774401 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 66:55:44:33:22:11 (oui Unknown), length 300

.

tcpdump -i br-lan "port bootps"
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br-lan, link-type EN10MB (Ethernet), capture size 262144 bytes
11:01:28.843017 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 66:55:44:33:22:11 (oui Unknown), length 300
11:01:30.800458 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 66:55:44:33:22:11 (oui Unknown), length 300

Any help appreciated :smile:

Try to set authorative to 0 and ignore dhcp on interface br0. So the main router can do his job.

But you have configured wwan. So you have to add wwan to lan br0 zone else there will be no dhcp requests forwarded to clients.

If you really want to seperate networks through nat then the re200 has to be the dhcp server. But i guess as repeater wwan should be bridged to lan and with disabled authorative and ignored dhcp on interface lan all should be good.

1 Like

Thanks a lot!

It looks like (un)configuring dhcp for the br-lan interface does the trick! I added this to /etc/config/dhcp:

config dhcp 'br-lan'
    option interface 'br-lan'
    option ignore '1'
    option authoritative '0'

And now the repeater does its job! :smile:
Thanks again!

I think the problem in the original config /etc/config/dhcp was here:

config dhcp 'lan'
    option interface 'lan'

which should be

config dhcp 'br-lan'
    option interface 'br-lan'

instead because the interface is named br-lan (and not lan), as ip link reveals:

ip link
...
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff

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