1 # SPDX-License-Identifier: GPL-2.0-or-later
3 . /lib/functions/uci-defaults.sh
5 . /lib/functions/system.sh
10 wg_set_opt_interface() {
14 ucidef_set_interface "$device" device "$device" protocol static ipaddr "10.0.${offset}.1" netmask 255.255.255.0
18 watchguard,firebox-m300)
19 ucidef_set_interfaces_lan_wan "eth1" "eth0"
20 wg_set_opt_interface "eth2" "2"
22 sweth_mac_offset=0x186d
24 for sweth in /sys/class/net/sweth*; do
25 device="$(basename "$sweth")"
26 mac="$(mtd_get_mac_text wg_cfg0 "$sweth_mac_offset")"
27 switchports="$switchports $device"
28 ucidef_set_network_device_mac "$device" "$mac"
29 wg_set_opt_interface "$device" "${device#sweth}"
30 sweth_mac_offset=$(printf "0x%X\n" $(( $sweth_mac_offset + 0x14)))