[openwrt/qmi] create interface, correct firewall parsing

This commit is contained in:
Nico Schottelius 2021-04-27 11:13:20 +02:00
parent 8e853e65de
commit 97598ef9c6
1 changed files with 13 additions and 27 deletions

View File

@ -12,45 +12,31 @@ my_ip=$1; shift
cat <<EOF | ssh -t "root@${my_ip}"
set -x
# update the sources & allow https handling
opkg update
opkg install libustream-openssl ca-bundle ca-certificates
# Install needed kernel module
opkg install kmod-usb-net-qmi-wwan uqmi luci-proto-qmi
# opkg install usb-modeswitch kmod-mii kmod-usb-net
# Create interface
# uci set network.lte=interface
# uci set network.LTE.ifname='${interface}'
# uci set network.lte.proto='qmi'
uci set network.lte=interface
uci set network.lte.device='/dev/cdc-wdm0'
uci set network.lte.proto='qmi'
uci set network.lte.apn='internet'
uci set network.lte.auth='both'
uci set network.lte.modes='lte'
uci set network.lte.pdptype='ipv4'
uci set network.lte.username='any'
uci set network.lte.password='any'
# add to correct firewall zone
# current_networks=\$(uci get firewall.@zone[1].network)
current_networks=\$(uci get firewall.@zone[1].network)
# if ! echo \$current_networks | grep -q LTE; then
# uci set firewall.@zone[1].network='\${current_networks} LTE'
# fi
if ! echo \$current_networks | grep -q lte; then
uci set firewall.@zone[1].network="\${current_networks} lte"
fi
# commit
uci commit
# reboot
reboot
EOF
exit 0
config interface 'lte'
option proto 'qmi'
option device '/dev/cdc-wdm0'
option apn 'internet'
option auth 'both'
option modes 'lte'
option pdptype 'ipv4'
option username 'any'
option password 'any'