[arch-general] Bridge interface with netctl
lisaev at umail.iu.edu
Tue Feb 25 14:55:35 EST 2014
On Tue, 25 Feb 2014 12:47:02 +0100
arnaud gaboury <arnaud.gaboury at gmail.com> wrote:
> Dear list,
> I am messing with assigning a static IP on a systemd-nspawn container,
> on both sides (host,container).
You assign an IP address only inside the container.
> My idea is to first create a bridge (br0) on the host.
> gabx at hortensia ➤➤ ~ % cat /etc/netctl/bridge-hortensia
> Description="Example Bridge connection"
This profile is wrong. Here is the right one:
$ cat /etc/netctl/lxc_lan_bridge
Description="LAN bridge for LXC containers"
Also, since you are running systemd >= 209, you can use networkd. Here are the
$ cat /etc/systemd/network/lxc_bridge.netdev
$ cat /etc/systemd/network/lxc_bridge.network
Description=LAN bridge for LXC containers
* Populate the iptables FORWARD chain to route traffic from your physical
interface to the bridge and back.
* Inside the container, get rid of dhcpcd, and use either networkd or netctl
to assign a static IP like you would do on a physical host.
* The simplest way to take care of DNS (that is without any additional host
configuration) is to use a static resolv.conf inside the container with a
public DNS service, e.g.
$ cat /var/lib/lxc/appserver1/rootfs/etc/resolv.conf
GPG key fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 490 bytes
Desc: not available
More information about the arch-general