I set my second router as a wifi repeater. I used this video to do that: https://www.youtube.com/watch?v=Bfmx5NjIWLQ&t=154s
I don't know the terms too much, but it connects to my main router without a cable, and distributes internet, wirelessly. But, I want it to also work, via cable. I mean if I have to plug a cable, it should work. How to configure it like that? Is it even possible? What is that configuration called?
Currently my lan ports do nothing. It won't recognize anything.
Let's take a look at your configuration:
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </>
" button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
ubus call system board:
{
"kernel": "5.15.137",
"hostname": "OpenWrt",
"system": "MediaTek MT7628AN ver:1 eco:2",
"model": "TP-Link Archer C50 v4",
"board_name": "tplink,archer-c50-v4",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "23.05.2",
"revision": "r23630-842932a63d",
"target": "ramips/mt76x8",
"description": "OpenWrt 23.05.2 r23630-842932a63d"
}
}
cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'someprefix/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 ipaddr '192.168.2.1'
option netmask '255.255.255.0'
config device
option name 'eth0.2'
option macaddr 'somemac'
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 'static'
option ipaddr '192.168.1.31'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/10300000.wmac'
option channel '1'
option band '2g'
option htmode 'HT20'
option cell_density '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
option disabled '1'
config wifi-device 'radio1'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
option channel '36'
option band '5g'
option htmode 'VHT80'
option cell_density '0'
config wifi-iface 'default_radio1' #this is unused
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
option disabled '1'
config wifi-iface 'wifinet2'
option device 'radio1'
option mode 'sta'
option network 'wwan'
option ssid 'ASUS_5G_guest1'
option encryption 'psk2'
option key 'mypass'
config wifi-iface 'wifinet3'
option device 'radio0'
option mode 'sta'
option network 'wwan'
option ssid 'ASUS_guest1'
option encryption 'psk2'
option key 'mypass'
cat /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 ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
cat /etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'wwan'
root@OpenWrt:~# cat /etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'wwan'
Your configuration looks like a basic routed config (i.e. the downstream lan subnet is different than the upstream) -- this should work fine, but you have several errors.
A reset to defaults will likely be the best starting place. Then all you need to do is configure a wwan that operates in sta mode (like you already have), associate the wwan network with the wan firewall zone, and change the lan subnet to something other than the default (your config shows 192.168.2.1/24 which will work).
You mean the client mode right? Not client(WDS) because I tried that, it didn't connect to internet.
If you have a good, not outdated wiki you can send me I can do it myself, no need to take your valuable time no more friend. Btw, happy new years y'all!
My recommendation is that this will behave a normal router with a wireless wan. It's not really an extender (where the upstream network is the same as the downstream) but your current configuration doesn't seem to be setup as such anyway, which is why I'm suggesting this method.
I am pretty lost here. I changed br-lan's ip address to 192.168.1.2 . Then, what would be wwan's ip address? Or do I leave it at dhcp? Still can't ping 192.168.1.1 this way
Your current configuration won't work.
What exactly are you trying to achieve? Do devices on the upstream wifi network (i.e. ASUS_5G_guest1
to which this device is connecting) the need to be able to reach devices on the downstream network (i.e. devices that are connected to the C50's wifi)?
The original configuration would work, as a routed client without NAT (symmetric routing). Symmetric routing requires adding a static route to the upstream (192.168.1.1) router: 192.168.2.0/24 via 192.168.1.31
.
This will also work with a wired connection by disabling the wifi client for wwan, and instead setting the wwan device (in /etc/config/network) to eth0.2. Then plug the Ethernet cable into the C50's wan port from one of the lan ports on the main router.
The wired connection works exactly the same, only certainly it will be faster. It remains the same symmetric routing topology so that it is simple to switch back and forth from wired to wireless.
Wireless connections can only be used bridged if the AP supports WDS or 802.11s mesh mode. Stock firmware almost never offers these modes.
As repeater it works fine, wireless works perfectly. I can reach to it from the main router just fine, the repeater can ping google.
I was asking if I could also use LAN ports. If some people might want to connect via LAN. I don't know how to do that. Is it even possible?
Also @mk24 mk24, I don't understand anything of what you said. So I simply do something like this?:
ip route add 192.168.2.0/24 via 192.168.1.31
The LAN ports are still in br-lan (via eth0.1) and would still work to serve 192.168.2.X IPs, except that whatever directions you have followed incorrectly told you to turn off the DHCP server on lan. In a routed topology the second router should be issuing DHCP addresses to its LAN.
The static route needs to be entered on your main router not the OpenWrt repeater device. If that router is not OpenWrt, the process will vary but almost all stock firmware does have a way to add static routes.
The problems I see are as follows:
There are two upstream connections, both using wwan as their network. This could cause a switching loop, and is generally not needed (use one or the other for the uplink, not both).
Both of the AP mode configs are disabled.... so there is no downstream wifi.
The lan DHCP is disabled (this is not absolutely required, but most devices will expect DHCP). Therefore the ethernet ports (which are connected to br-lan and the lan interface) will appear to be dead unless you use a static IP on the connected hosts.
The firewall has both lan and wwan in the same zone. This will preclude NAT masquerading (which isn't enabled, but wouldn't work on two networks on the same zone), and therefore no routing unless the upstream router has a static route to the lan on this device.
With all of those issues, I don't see how this device is acting as any kind of repeater or anything at all -- AP mode wifi isn't enabled, and the ethernet ports will appear non-functional for the reasons described above.
Am I missing anything here?
I get the first error finally. I fixed it. I removed the unused WIFI's.
Now my only problem is, it gets the internet from the router wirelessly but doesn't give it to the ethernet ports. How do I do it? Should I change br-lan ip address to something in range of 192.168.1.1-255? I don't get why 192.168.2.1, in the video the guy does it like that. All this stuff is really complicated. Do I add static route?
Please post the latest wifi config file.
As expected based on your current configuration.
Wifi doesn't have a simple method of making transparent repeaters or wifi client > wired downlinks. Doing so requires some little hacks such as WDS, relayd, or simply using the device in routing mode.
Maybe... but you didn't answer this:
Oh I get it now. Not needed. Would work even if they couldn't connect. Actually I could use the simplest choice, this is not important. Setting this up for my Airbnb.
cat /etc/config/wireless:
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/10300000.wmac'
option channel '1'
option band '2g'
option htmode 'HT20'
option cell_density '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'ASUS_Guest1'
option encryption 'psk2'
option key '.....'
config wifi-device 'radio1'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
option channel '36'
option band '5g'
option htmode 'VHT80'
option country 'TR'
option cell_density '0'
config wifi-iface 'wifinet2'
option device 'radio1'
option mode 'sta'
option network 'wwan'
option ssid 'ASUS_5G_Guest1'
option encryption 'psk2'
option key '.....'
Ok... so
- reset to defaults.
- Change your OpenWrt lan to 192.168.2.1 (it must not be the same as the upstream network which is why it must be changed). See this
- setup a wwan network (with DHCP client).
- assign that wwan network to the wan firewall zone
- connect that network with a sta-mode connection to the upstream network.
If this doesn't work or you need things to work in a slightly different way, let us know. Otherwise, if this all works as desired...
If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks!
Okay this worked. Thanks a lot! One more question, the wifi name can't be different than main router's wifi name, am I right? I have no way of knowing if I connect to the main router or the repeater this way. Not like I need it, just curious. When I connect via LAN cable on C50(repeater), it gives me 192.168.2.x IP's.
What if I answered yes to this though?
Actually, I would recommend making it different since it is a distinctly different network.
This would change the approach, depending on the details.
I tried, but it doesn't show up on wifi list. It's on client mode, not client(WDS) thing.
If it's complicated, maybe some other time.