]> git.proxmox.com Git - pve-manager.git/blame - network-hooks/bridgevlan
update shipped appliance info index
[pve-manager.git] / network-hooks / bridgevlan
CommitLineData
1010159a
AD
1#!/bin/sh
2
3if [ ! -x /sbin/bridge ] && [ ! -f /sys/class/net/$IFACE/bridge/vlan_filtering ]
4then
5 exit 0
6fi
7
8# Enabling vlan filtering feature
9if [ "$MODE" = "start" ] ; then
10
11 if [ -n "$IF_BRIDGE_VLAN_AWARE" ]
12 then
13 echo 1 > /sys/class/net/$IFACE/bridge/vlan_filtering
14 else
15 exit 0
16 fi
17
18fi
19
20. /lib/bridge-utils/bridge-utils.sh
21
22case "$IF_BRIDGE_PORTS" in
23 "")
24 exit 0
25 ;;
26 none)
27 INTERFACES=""
28 ;;
29 *)
30 INTERFACES="$IF_BRIDGE_PORTS"
31 ;;
32esac
33
34all_interfaces= &&
35unset all_interfaces &&
36bridge_parse_ports $INTERFACES | while read i
37do
38 for port in $i
39 do
40 if [ "$MODE" = "start" ] && [ -d /sys/class/net/$IFACE/brif/$port ]; then
804e0e38
DM
41 # we allow vlan to pass through attached interface
42 if [ -n "$IF_BRIDGE_VIDS" ]
43 then
311b67c7
AD
44 for VID in $IF_BRIDGE_VIDS
45 do
46 bridge vlan add dev $port vid $VID
47 done
804e0e38 48 else
ea92d8b6 49 bridge vlan add dev $port vid 2-4094
804e0e38 50 fi
1010159a
AD
51 fi
52 done
53done
54