Created
July 2, 2017 21:22
-
-
Save darthsuogles/ba27e99acad08828ab32caa21ed6c9d3 to your computer and use it in GitHub Desktop.
lxd container internet access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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