Is there a way to manually switch between WAN and WWAN? I'm also using PBR and don't want to have to change the PBR rules.
I thought I could just rename WWAN to WAN, but that doesn't work. If my DSL connection ever goes down, I'd like to connect via WWAN and continue browsing without having to change my PBR rules to WWAN. When I switch off WAN, I always get an error message from PBR saying that my WAN interface hasn't started yet. I'm using OpenWRT 24.4.
I did a quick and dirty script. I will improve it further, perhaps with WLAN profiles. But this way I can switch between DSL and a WWAN.
#
# RouterWechsel
#
# Alle Interfaces von wan auf wwan in PBR ändern
sed -i "s/option interface 'wan'/option interface 'wwan'/g" /etc/config/pbr
ifdown wan
uci delete network.wwan
uci delete wireless.wwan_client
uci set pbr.config.uplink_interface='wwan'
uci del_list pbr.config.ignored_interface='wan'
uci add_list pbr.config.ignored_interface='wan'
uci set network.wwan=interface
uci set network.wwan.proto='dhcp'
uci commit
# Erstellt eine neue Sektion für den WLAN-Client-Modus
uci add wireless wifi-iface
uci rename wireless.@wifi-iface[-1]=wwan_client
# Konfiguriert die Verbindung
uci set wireless.wwan_client.device='radio2'
uci set wireless.wwan_client.mode='sta'
uci set wireless.wwan_client.network='wwan'
uci set wireless.wwan_client.ssid='wlan_router_to_connect'
uci set wireless.wwan_client.encryption='psk2'
uci set wireless.wwan_client.key='password'
# Speichert die Konfiguration
uci commit
service network reload
#
# zum normalen DSL Modus umschalten
#
# alle Interfaces von wwan auf wan in PBR ändern
sed -i "s/option interface 'wwan'/option interface 'wan'/g" /etc/config/pbr
uci delete pbr.config.uplink_interface
uci del_list pbr.config.ignored_interface='wan'
uci delete network.wwan
uci commit
ifup wan
service network reload