Skip to content

Instantly share code, notes, and snippets.

@w1ndy
Created January 22, 2021 20:57
Show Gist options
  • Save w1ndy/be979dfd94e7d7ec1bd438d72c42f37f to your computer and use it in GitHub Desktop.
Save w1ndy/be979dfd94e7d7ec1bd438d72c42f37f to your computer and use it in GitHub Desktop.
Enable IPv6 passthrough with ebtables and prohibit unwanted incoming connections with iptables
modprobe ip6table_mangle
ebtables -t broute -A BROUTING -p ! ipv6 -j DROP -i eth2.2
brctl addif br0 eth2.2
echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 --state NEW -j DROP
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p udp --dport 6881 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 5000 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 6443 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 8096 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 16881 --state NEW -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment