-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-srp-i210.sh
executable file
·49 lines (35 loc) · 1.17 KB
/
config-srp-i210.sh
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
#!/bin/sh
BR=br0
HANDLE=9000
for INDEX in 4 8s0
do
ETH="ens${INDEX}"
echo "Unconfiguring ${ETH} Qdisc..."
tc qdisc del dev ${ETH} parent root handle ${HANDLE} mqprio
echo "${ETH} unconfigured\n"
done
set -e
echo "Configuring customer bridge MRP group address forwarding"
nft delete table bridge nat || : >/dev/null 2>&1
#ip link set dev ${BR}.50 type vlan mvrp on
#ip link set dev ${BR}.51 type vlan mvrp on
nft add table bridge nat
nft add chain bridge nat PREROUTING { type filter hook prerouting priority dstnat\; policy accept\; }
# note we don't need to drop LLDP because it's not forwarded by the bridge,
# whereas the MMRP/MVRP multicast address is (we need to intercept it)
nft add rule bridge nat PREROUTING meta ibrname ${BR} ether daddr 01:80:c2:00:00:21 log group 10 drop
nft list ruleset
echo ""
# https://tsn.readthedocs.io/qdiscs.html
for INDEX in 4 8s0
do
ETH="ens${INDEX}"
echo "Configuring ${ETH} Qdisc..."
tc qdisc del dev ${ETH} parent root handle ${HANDLE} || : >/dev/null 2>&1
tc qdisc add dev ${ETH} parent root handle ${HANDLE} mqprio \
num_tc 3 \
map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \
queues 2@2 1@1 1@0 \
hw 1
echo "${ETH} configured!\n"
done