How to configure OpenWrt according to this diagram?

Hi everyone. My device is as follows

Hostname OpenWrt
Model TP-Link Archer C20i
Architecture MediaTek MT7620A ver:2 eco:6
Firmware Version OpenWrt 21.02.1 r16325-88151b8303 / LuCI openwrt-21.02 branch git-21.295.67054-13df80d
Kernel Version 5.4.154

...and I would like to configure it according to the following diagram

  • OpenWrt router (WAN port) connected to the main internet router (LAN port) via cable (CAT5)
  • OpenWrt router to repeat the WiFi signal (AP)
  • OpenWrt router to serve DHCP on LAN ports (Wired connections)

How could I accomplish such configuration? (Preferably via LuCi) Thank you in advance for any help.

Can't use the same LAN subnet on both routers if they're connected LAN-WAN.

Set up the openwrt router as dumb ap instead.


@frollic I've looked at this solution but it doesn't fit what I want. And if for my requested setup I can't use the same LAN subnet. I don't mind using a different one as long as I can accomplish it.
I need the OpenWrt to GET internet from the main internet router through the WAN port (wired) and PROVIDE internet through its LAN ports and WiFi (Repeating the signal from the main router).

Your diagram shows everything in the same subnet. This means the first router will be a typical home main router, which is basically OpenWrt's default setup. Every device in the house is part of its LAN network.

The second one will be a dumb AP. The important thing is that the cable connecting the two routers needs to be in the lan network of both of them. On the dumb AP, you can reassign the WAN physical port to be a fifth lan port, or just not use it and plug the interconnect cable into one of the LAN ports instead.

1 Like

@mk24, I might not be explaining myself correctly. Let's try it again.

On the second router (OpenWrt Dumb AP) I want;
WAN PORT -> Internet coming from main router (LAN port, DHCP)
LAN PORTS -> I want to be able to plug any device via wire and have Internet.
WIFI -> Repeat signal from main router.

It'll do it, as dumb ap too, except for WAN, which you haven't explained, why it's an absolute must.

1 Like

In a dumb AP, all the ports and the wifi are bridged into one network, the LAN. After reassigning the WAN port to be in the LAN, it will work exactly the same as the other ones and you can plug in cables however you want. If you don't reassign the port you can still make a dumb AP with the other four and just don't use the WAN port.

1 Like

Understood @mk24. But this doesn't solve it. I guess the nomenclatures are making things difficult.
All I want to to configure this OpenWrt router to receive internet from the main router through the WAN port and provide internet through the LAN ports and repeat the Wifi signal. Seems simple saying, but I just don't know how to configure it.

Solve what ?

It'll do just that, but why does it have to be through a WAN port ?

If you don't want to reconsider, or explain why, simply change the LAN subnet on the openwrt router, to something else than 192.168.1, and you're good to go.

Don't forget to enjoy the double NATing...

1 Like

I think you are somewhat confused based on this statement. Can I assume that prior to adding your OpenWrt router you plugged your PC into your Internet router lan port and your wireless devices also connected to the Internet router?

Hi @RuralRoots, that's exactly it. So now, instead of connecting my PC to my internet router. I want to connect the OpenWrt to it (using the WAN port). Not only that, I also want to be able to connect other PCs to the LAN ports of the OpenWrt and have it as a Wireless AP.

To be clear, the requirement that it must be the WAN port that connects to the upstream router is only really useful if you need to have the other 4 LAN ports available for other devices and/or you want that port to be unique as a simple physical reminder of where the wire goes. But in truth, there is nothing special about the WAN port here since it is easily configured to behave as 'just another port' on your device.

It seems that you want to use all of the ports on the back (WAN + 4x LAN) as a 5-port switch -- all on the same network -- making the device a simple switch + dumb AP. This is possible to do since the WAN port is connected to the internal switch. The C20i will not be routing at all -- everything will be on the same network as the upstream network.

You'll start by setting up the device as a dumb AP (as was linked earlier), and then you'll make a small change to the switch configuration so that the WAN port is a member of the LAN and therefore 'just another port'.


Hi @psherman and thank you for your response. You got it 99% right!
Yes! I want to use the WAN port for upstream to leave the other 4 ports to physically connect anything I want. Plus, I want it to be a wireless repeater to extend the wifi signal. I can follow the tut to configure it as a dumb AP. But wouldn't know how to accomplish the rest. Could you walk me through the steps?

You can't connect cable and wifi from the same subnet, at the same time, it'll crate a loop killing the whole network.

Be careful with the language you use. A "wireless repeater" typically means that it is not connected by a wire. It is literally connecting to an upstream network via a wireless connection (typically these devices have 2 radios -- one for the uplink to the existing network, the other to 're-broadcast' the network).

What you are really doing here is a dumb AP that is wired to the network.

Follow the tutorial (using a LAN port for now), then post your /etc/config/network file and we'll tell you how to get the WAN port to behave as part of the LAN.

1 Like

@frollic, I don't mind if I have to create a separate subnet for the OpenWrt as long as I can accomplish what I need.

I really don't think you want to do this, based on your diagram. If you want everything to be a part of the same network, you want to setup a dumb AP.

@psherman, I have factory reset the OpenWrt and finished configuring the router following the steps of the
I have skipped steps 10,11 and 12 for now and below please find the config file.

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

config globals 'globals'
option ula_prefix 'fdb8:e861:1b32::/48'

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

config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask ''
option ip6assign '60'
option ipaddr ''
option gateway ''
list dns ''

config device
option name 'eth0.2'
option macaddr 'c4:6e:1f:59:ea:76'

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

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 '1 2 3 4 6t'

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

config interface 'wwan'
option proto 'dhcp'

all you need to do is remove port 0 from the above, and add it below

config switch_vlan
    option device 'switch0'
    option vlan '1' 
    option ports '1 2 3 4 6t'

@psherman: I don't quite understand what exactly the change I need to make. Besides, the LAN ports are set as static IP now and I want to be able to plug a PC in them and get an IP from the main router.