-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtecff-block-fastd-loop
executable file
·15 lines (15 loc) · 1.25 KB
/
tecff-block-fastd-loop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# IFACE and MODE are set as an environment variable by ifupdown
if [ "$MODE" = "start" ]; then
ip6tables -I INPUT -d 2a01:4f8:10b:1265::3/128 -i $IFACE -p udp --dport 10000:11000 -j REJECT --reject-with icmp6-adm-prohibited
ip6tables -I FORWARD -d 2a01:4f8:171:2b48::119/128 -i $IFACE -p udp --dport 10000:11000 -j REJECT --reject-with icmp6-adm-prohibited
ip6tables -I INPUT -d 2a01:4f8:10b:1265::3/128 -i $IFACE -p udp --dport 10000:11000 -m limit --limit 2/sec -j LOG --log-prefix 'fastd over mesh: '
ip6tables -I FORWARD -d 2a01:4f8:171:2b48::119/128 -i $IFACE -p udp --dport 10000:11000 -m limit --limit 2/sec -j LOG --log-prefix 'fastd over mesh: '
elif [ "$MODE" = "stop" ]; then
ip6tables -D INPUT -d 2a01:4f8:10b:1265::3/128 -i $IFACE -p udp --dport 10000:11000 -m limit --limit 2/sec -j LOG --log-prefix 'fastd over mesh: '
ip6tables -D FORWARD -d 2a01:4f8:171:2b48::119/128 -i $IFACE -p udp --dport 10000:11000 -m limit --limit 2/sec -j LOG --log-prefix 'fastd over mesh: '
ip6tables -D INPUT -d 2a01:4f8:10b:1265::3/128 -i $IFACE -p udp --dport 10000:11000 -j REJECT --reject-with icmp6-adm-prohibited
ip6tables -D FORWARD -d 2a01:4f8:171:2b48::119/128 -i $IFACE -p udp --dport 10000:11000 -j REJECT --reject-with icmp6-adm-prohibited
else
exit 1
fi