-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc-bridge.poststart
61 lines (60 loc) · 2.6 KB
/
rc-bridge.poststart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/ash
#version redama 0.1
#----Vlan Database----
ADM_VLAN=100
NETFLIX_VLAN=111
DATA_VLAN=131
VOZ_VLAN=213
#----------------------
if [[ $(/usr/bin/ip link | grep -c $NETFLIX_VLAN) -ne 0 ]]; then
ctrl_netflix=1
fi
if [[ $(/usr/bin/ip link | grep -c $VOZ_VLAN) -ne 0 ]]; then
ctrl_voz=1
fi
/usr/bin/ip link set mtu 1496 dev "ath0.$ADM_VLAN"
/usr/bin/ip link set mtu 1496 dev "eth0.$ADM_VLAN"
/usr/bin/ip link set mtu 1496 dev "ath0.$DATA_VLAN"
/usr/bin/ip link set mtu 1496 dev "eth0.$DATA_VLAN"
#others VLANs
[[ $ctrl_netflix ]] && \
/usr/bin/ip link set mtu 1496 dev "eth0.$NETFLIX_VLAN" && \
/usr/bin/ip link set mtu 1496 dev "ath0.$NETFLIX_VLAN"
[[ $ctrl_voz ]] && \
/usr/bin/ip link set mtu 1496 dev "eth0.$VOZ_VLAN" && \
/usr/bin/ip link set mtu 1496 dev "ath0.$VOZ_VLAN"
#CoS bit
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 0 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 1 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 2 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 3 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 4 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 5 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 6 1
/usr/bin/vconfig set_egress_map "ath0.$ADM_VLAN" 7 1
[[ $ctrl_netflix ]] && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 0 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 1 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 2 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 3 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 4 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 5 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 6 6 && \
/usr/bin/vconfig set_egress_map "ath0.$NETFLIX_VLAN" 7 6
[[ $ctrl_voz ]] && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 0 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 1 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 2 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 3 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 4 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 5 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 6 6 && \
/usr/bin/vconfig set_egress_map "ath0.$VOZ_VLAN" 7 6
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 0 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 1 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 2 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 3 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 4 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 5 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 6 3
/usr/bin/vconfig set_egress_map "ath0.$DATA_VLAN" 7 3