Table of Contents
- Ubuntu 14.04 LTS (Trusty Tahr)
LXC(LinuX Container) has only one network interface when its created, so we have to add other interfaces manually.
sudo lxc-create -t download -n <cotnainer name> -- -d ubuntu -r trusty -a amd64
And now, LXC creates a pair of tap devies. One connects to container, another one connects to OVS bridge.
You will see somthing like this in /var/lib/lxc/<container name>/config
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:aa:cc:9c
Just copy/paste original network configuration in file and change
- lxc.network.hwaddr (MAC address)
Optional:
- lxc.network.link (the bridge name that virtual interface connects to)
/var/lib/lxc/<container name>/config
# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:aa:cc:9c
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:aa:cc:9D
See Also
- LXC with OpenvSwitch
- Kubernetes - Two Steps Installation
- Adopting Container and Kubernetes in Production
- Check Containers Status with Ctop
- Building Minimal Docker Image for Go Applications
To reproduce, republish or re-use the content,
please attach with link: https://tachingchen.com/
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email