Skip to content

Instantly share code, notes, and snippets.

@darthsuogles
Created July 2, 2017 21:22
Show Gist options
  • Select an option

  • Save darthsuogles/ba27e99acad08828ab32caa21ed6c9d3 to your computer and use it in GitHub Desktop.

Select an option

Save darthsuogles/ba27e99acad08828ab32caa21ed6c9d3 to your computer and use it in GitHub Desktop.
lxd container internet access
#!/bin/bash
lxc profile device set default eth0 parent enp2s0
lxc profile device set default eth0 nictype macvlan
# https://insights.ubuntu.com/2016/04/07/lxd-networking-lxdbr0-explained/
cat <<EOF | sudo tee /etc/network/interfaces.d/containerbr.cfg
auto containerbr
iface containerbr inet dhcp
bridge_ports eth0
EOF
lxc profile device set default eth0 parent containerbr
# >> There should be a file /etc/network/interfaces
# >> with content similar to the following
# # This file describes the network interfaces available on your system
# # and how to activate them. For more information, see interfaces(5).
# source /etc/network/interfaces.d/*
# # The loopback network interface
# auto lo
# iface lo inet loopback
# # The primary network interface
# auto enp2s0
# iface enp2s0 inet dhcp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment