File: setup_lxd.sh

package info (click to toggle)
golang-github-rootless-containers-bypass4netns 0.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 596 kB
  • sloc: sh: 1,936; python: 542; makefile: 33
file content (15 lines) | stat: -rwxr-xr-x 442 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

set -eux -o pipefail

cd $(dirname $0)

sudo modprobe vxlan
cat lxd.yaml | sudo lxd init --preseed
sudo sysctl -w net.ipv4.ip_forward=1

#https://andreas.scherbaum.la/post/2023-01-18_fix-lxc-network-issues-in-ubuntu-22.04/
sudo iptables -I DOCKER-USER -i lxdbr0 -o eth0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -F FORWARD
sudo iptables -P FORWARD ACCEPT