Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checksums.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
31eb2c54fa3b815e397261706d06d6755f41e26d09094b84175846a946b0e366 glinet-vlan-qos.sh
6923874031aaf63bfd46abdc9e0534f31e333c05998f1a2b9e8cd43bda7129f1 glinet-vlan-qos-setup.sh
f3f9c3b78f3df03574a1f0a1e28a9bd5315f0c462437af162671cfddf20f2a38 glinet-vlan-qos.sh
77857db4cc80629f5897d1026764f51721de82c2b70c98b6f61693fc1a6b90c7 glinet-vlan-qos-setup.sh
14 changes: 8 additions & 6 deletions glinet-vlan-qos-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,24 @@ select_priority() {
for br in /sys/class/net/br-*; do
[ -d "$br" ] || continue
br=$(basename "$br")
# Skip IFB devices (e.g., br-lan-ifb) — they're for traffic mirroring, not QoS
case "$br" in
*-ifb) continue ;;
esac
discovered="$discovered $br"
done
# Add tailscale0 if present
[ -d /sys/class/net/tailscale0 ] && discovered="$discovered tailscale0"

for b in $discovered; do
read -p "Priority for $b (1-3, 0 to skip): " -r pri
local config_name
# Convert bridge name to config variable suffix (e.g., br-lan -> LAN)
case "$b" in
br-lan|lan) config_name="LAN" ;;
br-iot|iot) config_name="IOT" ;;
br-guest|guest) config_name="GUEST" ;;
tailscale0|tailscale) config_name="TAILSCALE" ;;
br-*) config_name=$(echo "$b" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;;
*) config_name=$(echo "$b" | tr '[:lower:]' '[:upper:]') ;;
br-*) config_name=$(echo "$b" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
*) config_name=$(echo "$b" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
Comment on lines +139 to +140
esac

case "$pri" in
Expand Down Expand Up @@ -218,8 +220,8 @@ write_config() {
br-iot|iot) config_name="IOT" ;;
br-guest|guest) config_name="GUEST" ;;
tailscale0|tailscale) config_name="TAILSCALE" ;;
br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;;
*) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]') ;;
br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
*) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
esac

# Use stored bandwidth if available, otherwise default
Expand Down
8 changes: 6 additions & 2 deletions glinet-vlan-qos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ discover_bridges() {
for br in /sys/class/net/br-*; do
[ -d "$br" ] || continue
br=$(basename "$br")
# Skip IFB devices (e.g., br-lan-ifb) — they're for traffic mirroring, not QoS
case "$br" in
*-ifb) continue ;;
esac
Comment on lines +117 to +120
idx=$((idx + 1))
local mark=$((16 + (idx - 1) * 16)) # 0x10, 0x20, 0x30, ...
echo "${br} ${mark}"
Expand Down Expand Up @@ -186,8 +190,8 @@ get_bw_config() {
br-iot|iot) config_name="IOT" ;;
br-guest|guest) config_name="GUEST" ;;
tailscale0|tailscale) config_name="TAILSCALE" ;;
br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]') ;;
*) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]') ;;
br-*) config_name=$(echo "$br" | sed 's/br-//' | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
*) config_name=$(echo "$br" | tr '[:lower:]' '[:upper:]' | tr '-' '_') ;;
esac

eval "up_bw=\${QOS_${config_name}_BW_UP:-}"
Expand Down
Loading