Add the network entries that bsbf-autoconf-cellular and bsbf-autoconf-dhcp
create, to the firewall wan zone.
Signed-off-by: Chester A. Unal <redacted>
include $(TOPDIR)/rules.mk
PKG_NAME:=bsbf-openwrt-resources
-PKG_VERSION:=3
+PKG_VERSION:=4
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Chester A. Unal <chester.a.unal@arinc9.com>
uci set network.wwan$index.apn='internet'
uci set network.wwan$index.peerdns='0'
uci set network.wwan$index.metric="$metric"
-uci commit network
+
+# Add wwan network entry to firewall wan zone.
+fw_section=$(uci show firewall | grep "name='wan'" | cut -d. -f2)
+[ -n "$fw_section" ] && uci add_list firewall.$fw_section.network="wwan$index"
+
+uci commit
+service firewall reload
ifup wwan$index
uci set network.wan_"$DEVICENAME".proto='dhcp'
uci set network.wan_"$DEVICENAME".peerdns='0'
uci set network.wan_"$DEVICENAME".metric="$metric"
-uci commit network
+
+# Add wan network entry to firewall wan zone.
+fw_section=$(uci show firewall | grep "name='wan'" | cut -d. -f2)
+[ -n "$fw_section" ] && uci add_list firewall.$fw_section.network="wan_$DEVICENAME"
+
+uci commit
+service firewall reload
ifup wan_"$DEVICENAME"