Hello, I need help configuring the WLAN network. I have a Raspberry Pi B+ with two WLAN USB cards. I would like one card to be connected to my home WIFI and the other one to send the network further with a different SSID and a different IP address. I'm completely new to openwrt and have no idea how to set it up. OpenWRT is freshly installed without any configuration changes. I only installed the drivers for the WLAN cards to work.The home network is on 2.4 GHz. and the second WLAN card is supposed to broadcast it on 5 GHz.
Just to set expectations -- your Pi will probably not perform all that well with respect to the wifi, even with the USB wifi adapters. As a general rule, USB wifi adapters don't have great range or bandwidth, and most typical wifi APs or all-in-one wifi routers will outperform them.
That said, it sounds like you're aiming to setup is a routed configuration running with a wifi uplink. This means that the wifi AP will broadcast a different network -- is that your intent? If so... start with a default configuration and then follow this:
you'll make the sta mode connection and associate it with a network called wwan
(which will in turn be associated with the wan firewall zone). Then the lan will 'just work' as long as the subnet does not conflict.
I did everything as you wrote, I can connect to the network, I get an IP assigned to the LAN interface, but unfortunately I have no Internet.
It is possible there is a subnet overlap.
Let's look at the following:
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
And also this:
ubus call network.interface.wwan status | grep address
Ok, Results of all commands:
root@OpenWrt:~# 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 'fd57:70d2:768f::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
list ipaddr '192.168.10.1/24'
config interface 'wwan'
option proto 'dhcp'
root@OpenWrt:~# cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0'
option channel '1'
option band '2g'
option htmode 'HT20'
option cell_density '0'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/20980000.usb/usb1/1-1/1-1.5/1-1.5:1.0'
option channel '1'
option band '2g'
option htmode 'HT20'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'wwan lan'
option mode 'ap'
option ssid 'free-wlan'
option encryption 'none'
config wifi-iface 'wifinet2'
option device 'radio0'
option mode 'sta'
option network 'wwan'
option ssid 'ssid'
option encryption 'psk2'
option key 'passwd'
root@OpenWrt:~# 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 dhcpv6 'hybrid'
option ra 'hybrid'
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'
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'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
list network 'wwan'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
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'
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'
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'
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'
root@OpenWrt:~# ubus call network.interface.wwan status | grep address
root@OpenWrt:~#
root@OpenWrt:~# ubus call system board
{
"kernel": "5.15.134",
"hostname": "OpenWrt",
"system": "ARMv6-compatible processor rev 7 (v6l)",
"model": "Raspberry Pi Model B Plus Rev 1.2",
"board_name": "raspberrypi,model-b-plus",
"rootfs_type": "ext4",
"release": {
"distribution": "OpenWrt",
"version": "23.05.0",
"revision": "r23497-6637af95aa",
"target": "bcm27xx/bcm2708",
"description": "OpenWrt 23.05.0 r23497-6637af95aa"
}
}
I forgot about this one.
remove wwan from this:
This may suggest that the wwan interface doesn't have an address.
After making the change above, reboot your device and then see if it gets an address.
I don't know why he didn't get the address. when connecting to the network, it immediately showed me the IP. restarting the device helped.
ubus call network.interface.wwan status | grep address
"addresses",
"ipv4-address": [
"address": "192.168.178.54",
"ipv6-address": [
"ipv4-address": [
"ipv6-address": [
Ok, it helped, everything works. So it was my mistake that I added WWAN to the new network?
Yeah. I expect that was what caused the problem.
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!
Ok, I learned something new. Thank you very much for your help!
Hello, I have one more question about Raspberry Pi. I have an RPi 4 B, and I would like to transmit in 2.4 GHz and 5 GHz simultaneously. Is such a thing possible? Raspberry receives the Internet via the Ethernet port.
Not with the built-in wifi chip -- it can only be used on one band or the other. If you use a usb wifi adapter that supports AP mode, you can use that to broadcast on the other band.
Thank you for such a quick answer, and can you tell me which USB wifi card works best with OpenWRT?
Nope... not me. I don't have any experience with them. Keep in mind that some don't support AP mode, so you'll have to make sure you select one that does. And most of them don't have particularly great performance... it'll typically be a bit better than the Pi's built-in wifi, but that is a very low bar. You are always better off with a purpose built AP rather than a USB wifi adapter.
Use the search function on the forum (and/or check the hardware section) for recommendations on USB wifi adapters.
The best solutions (by a far margin) is an external AP, something like dap-x1860/ covr-x1860/ wsm20 on the entry level, stability, reliability, range and performance beat any USB WLAN card - and it even doesn't cost more.
ok, what does the OpenWRT installation process look like? And is it possible to replace the original MAC address of the network card?
a.1) depends on the device
a.2) https://openwrt.org/docs/guide-user/network/wifi/dumbap
b) yes
Ok, thank you for all the information. It helped me a lot. I have one last question about the USB card, I bought an RTL8188 card a long time ago, I know that the quality is very bad, but is it possible to run it in OpenWRT?
Are you sure that chip inside does not have a suffix?
I can find the "RTL8188 card" but the chip inside is eluding me.
Hi, I'm trying to compile driver for RTL8189ES for the OPi R1 board. I've used patch from Hauke Mehrtens and latest git distro. All compiles well, but the wifi works only in scan mode. When tried to enable AP, the wlan0 disappears for ever. It's not available even after hard reset. All modules are persistent. Any ideas what may be wrong?
Put it in a Windows machine and see if it can define the chip in device manager.
Windows detects it as:
Realtek RTL8188FTV Wireless LAN 802.11n USB 2.0 Network Adapter.