Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save planetbeing/7c8f919a4dfbacf7681145a402884dbd to your computer and use it in GitHub Desktop.
Save planetbeing/7c8f919a4dfbacf7681145a402884dbd to your computer and use it in GitHub Desktop.
[Unit]
Description=Create cbr0 and add rules to allow microk8s containers to have networking.
[Service]
ExecStart=/sbin/ip link add name cbr0 type bridge
ExecStart=/sbin/iptables -A FORWARD -i cbr0 -j ACCEPT
ExecStart=/sbin/iptables -A FORWARD -o cbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
ExecStart=/sbin/iptables -P FORWARD DROP
TimeoutStopSec=30
Type=oneshot
[Install]
WantedBy=multi-user.target
RequiredBy=snap.microk8s.daemon-docker.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment