Hi! I changed my router (Xiaomi Mi Router 3G - OpenWRT compatible) and decided to contract an extra ISP provider (due connectivity issues). I would like to create two separate WLAN for each one. I installed OpenWRT to the new router and managed to configured 1 ISP so far.
After reading a bunch of materials, I decided to create new VLANS in the Switch part of the settings.
The Idea is:
ISP #1 => WAN port - DHCP Client
ISP #2 => LAN port 3 - PPoE Connection
The ideia is when I connect to:
WIFI #1 => LAN #1 => ISP #1
WIFI #2 => LAN #2 => ISP #2
I'm having problems trying to create new VLANS and associate LAN/WLAN in the Switch section. It seems I'm not able to create the right setup for each one.
You have one mess of a config there... What you need is quite easy to configure, once you know the semantics of that file.
But before we start, I need to confirm which device are you using, because the "Xiaomi Mi Router 3G" seems to have only two LAN ports and one WAN port, so I am a bit confused with your idea of two WAN connections and two LAN connections.
Once we clarify that, I can guide you with the config.
According to my understanding you probably need 4 different networks. Each one for Lan 1 and 2 and then each for Wan 1 and 2.
Now if you use Lan/Wan ports to connect to the modems etc, then you will need at least 2 physical ports to connect them. First you’ll need to create your Lan networks Lan1 and Lan2. You don't really need to add any physical ports to them if you dont want to. If you want physical ports associated with them for access then you’ll need 4 VLANs also.
Create your VLANs as you need them. Create your networks for Lan1 and Lan2 and associate them with VLANs leaving two VLANs for Wan1 and Wan2. It's better to use static ip and LuCI to configure the network as it's easier.
After you are done with Lan networks, you will create two networks for Wan1 and Wan2. Again you’ll associate the remaining VLANs to them and configure them as your ISP says so.
Edit: Once you are done creating networks you'll need to add forwarding from Lan1 to Wan1 and from Lan2 to Wan2.
You'll probably be wondering if you can have only one subnet and access both ISPs but I don't think if that's possible but please correct me if I am wrong. I can't really add any config here because I don't want to spend much time on it. But you should be able to do it from wiki.
Well i see what you're trying to do but not what problem it solves better than mwan3
Here's what I can suggest which is start over and just get the two wans up and running. They shouldn't be bridges, just single interfaces. Then, you create two LANs, which are just attached to the two wlan interfaces.
Now you use static policy routing to route one SSID to one wan and the other SSID to another wan.
But mwan3 will give you load balancing and fault tolerance...
Now the WAN port should be at eth0.1, and the LAN ports at eth0.2 and eth0.3. I would leave the WAN port as an "emergency" port, so you can always reach the router using a wire:
You do not need to do anything on the switch for the WLANs, just configure the interfaces:
config interface 'lan1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.98.1'
option netmask '255.255.255.0'
config interface 'lan2'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.99.1'
option netmask '255.255.255.0'
(and the corresponding at /etc/config/dhcp and /etc/config/wireless).
This should give you one AUX "emergency" interface on the WAN port, two WAN interfaces on the LAN ports, and two LAN interfaces ready to be bridged to their wireless counterparts. Then you can configure the firewall and the routing to redirect the traffic from each LAN interface to a WAN interface.
It's possible that one ISP filters certain traffic, or bills unevenly for certain things. Or the connection is metered and the user doesn't want YouTube traffic burning through their precious allotment.
Or a half-dozen other scenarios I can think of off the top. Instead of telling them their question is wrong, maybe we can help them solve the problem they have?
I love this community because it's supportive and inclusive. Let's not devolve into Stack Overflow.
People often want something because it's the only thing they know to want, particularly people new to networking. It pays to establish that there is a good reason for wanting something unusual before setting people up with a suboptimal solution. For example it is possible to use routing rules or proxy config to send all YouTube to a given ISP and then you don't have a problem where you forgot to switch SSIDs and now you have an enormous bill... Or whatever. Understanding the underlying goal is often important.
I followed your example, made necessary changes to dhcp and firewall too. But it seems I'm not able to freely switch between wlans and browse. I have to restart the respective wan interface every time, in order to make it work.
Example:
I'm connected to WLAN #1 (LAN #1 => WAN #1), browsing normally.
Then I decide to switch to WLAN #2 (LAN #2 => WAN #2)
When I try to access internet. Cannot resolve host error appears.
I go to Luci > Network > Interfaces > WAN #2 => Restart
I can browse normally through WAN #2
Switch back to WLAN #1
I have to restart WAN #1 to make it work properly
LuCi shows both WAN #1 and WAN #2 online and properly connected. Idk why I need to restart every time I try to use them.
My /etc/config/firewall config:
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'lan'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan wan6'
config zone
option forward 'REJECT'
option output 'ACCEPT'
option input 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan2'
option name 'wan2'
config zone
option name 'lan2'
option input 'ACCEPT'
option output 'ACCEPT'
option network 'lan2'
option forward 'ACCEPT'
config forwarding
option src 'lan'
option dest 'wan'
config forwarding
option dest 'wan2'
option src 'lan2'
It seems the router get "lost", idk what I'm missing here.