[SOLVED] Impossible to create 2 wifi on the same device

Hi,

I'm going crazy with OpenWrt. My problem is I'd like to have 2 wifi on the device.
One wifi private with no limit as Upload & Download speed, and another on for guest with limit as Upload & Download speed.

To do that,

  • File wifiless:
    I defined 2 wifi-iface in the wireless config file attached to the same wifi-device 'ra0':
config wifi-iface
	option device 'ra0'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key 'mypasswd'
	option isolate '1'
	option ssid 'MyWifiPrivate'

config wifi-iface
	option network 'wifiguest'
	option device 'ra0'
	option mode 'ap'
	option ssid 'TheWifiForGuest'
	option encryption 'psk2'
	option key 'guestpasswd'
	option isolate '1'

The private wif is attached to the network LAN, the second one (guest) has his own network

  • File network:
    Into the network config file, I defined the interface for the guest:
config interface 'wifiguest'
	option type 'bridge'
	option _orig_ifname 'ra0 ra1'
	option _orig_bridge 'true'
	option proto 'static'
	option ipaddr '192.168.1.2'
	option netmask '255.255.255.0'
	option ifname 'ra0 ra1'

NB/ I don't know from where comes the ra1 (LUCI makes files like that)...

concerning the lan:

config interface 'lan'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option macaddr '78:a3:51:44:73:b6'
	option ifname 'eth0.1'
  • File firewall
    About the firewall:
config zone
	option name 'wifiguest'
	option forward 'REJECT'
	option output 'ACCEPT'
	option network 'wifiguest'
	option input 'REJECT'

config forwarding
	option src 'wifiguest'
	option dest 'wan'
  • File dhcp
    the Guest wifi has his own DHCP:
config dhcp 
	option leasetime '1h'
	option interface 'wifiguest'
	option start '200'
	option limit '250'
  • File qos
    To define traffic limits, I use QoS:
config interface 'wifiguest'
	option classgroup 'Default'
	option enabled '1'
	option download '1000'
	option upload '1000'

Now, my problem is that does not work... I'm not able to connect on any wifi SSID...
I also tried to define a specific interface for the private wifi (like I did it for the guest) but it does not work...
I'm stuck, and don't see what's wrong ? If someone can help ?
Thank you
BR
Sebastien

NB/ Router is ZBT-826T

Remove that line

The IP address ranges for lan and wifiguest are identical, but they must be different. Replace

	option ipaddr '192.168.1.2'

with

	option ipaddr '192.168.2.1'

for interface wifiguest. Also follow the advice given by @jow above.

Hi, thank for help.
I tried your different settings one by one... but without any good result. Sure, the IP for wireless wasn't good, and I removed bad lines provided by LUCI.

Actually, after few tries, I found the problem (don't know why but now it's working).
I changed on the firewall setting the incoming to ACCEPT (before it was REJECT)...

So, a configuration that works for me:

====== wireless file ======

config wifi-iface
	option device 'ra0'
	option network 'wifiguest'
	option mode 'ap'
	option encryption 'psk2'
	option key 'yourpasswd'
	option ssid 'Guest'

config wifi-iface
	option device 'ra0'
	option network 'wifiprivate'
	option mode 'ap'
	option encryption 'psk2'
	option key 'yourpasswd'
	option ssid 'Private'

====== Network file =======

config interface 'wifiguest'
	option _orig_ifname 'ra0'
	option _orig_bridge 'true'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	option type 'bridge'
	option ifname 'ra0'

config interface 'wifiprivate'
	option _orig_ifname 'ra1'
	option _orig_bridge 'true'
	option proto 'static'
	option ipaddr '192.168.3.1'
	option netmask '255.255.255.0'
	option type 'bridge'
	option ifname 'ra1'

====== DHCP file =======

config dhcp 'wifiguest'
	option leasetime '1h'
	option interface 'wifiguest'
	option start '100'
	option limit '150'

config dhcp 'wifiprivate'
	option leasetime '12h'
	option interface 'wifiprivate'
	option start '100'
	option limit '150'

====== Qos file =======

config interface 'wifiguest'
	option classgroup 'Default'
	option enabled '1'
	option download '1000'
	option upload '1000'

====== firewall file =======
config zone
option name 'wifiguest'
option network 'wifiguest'
option output 'ACCEPT'
option forward 'REJECT'
option input 'ACCEPT'

config zone
option name 'wifiprivate'
option network 'wifiprivate'
option output 'ACCEPT'
option forward 'REJECT'
option input 'ACCEPT'

config forwarding
option dest 'wan'
option src 'wifiguest'

config forwarding
option dest 'wan'
option src 'wifiprivate'

hope it helps someone for the futur.
BR
Sebastien

1 Like

Solved for me. Thank you

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