Book Image

Containerization with LXC

Book Image

Containerization with LXC

Overview of this book

In recent years, containers have gained wide adoption by businesses running a variety of application loads. This became possible largely due to the advent of kernel namespaces and better resource management with control groups (cgroups). Linux containers (LXC) are a direct implementation of those kernel features that provide operating system level virtualization without the overhead of a hypervisor layer. This book starts by introducing the foundational concepts behind the implementation of LXC, then moves into the practical aspects of installing and configuring LXC containers. Moving on, you will explore container networking, security, and backups. You will also learn how to deploy LXC with technologies like Open Stack and Vagrant. By the end of the book, you will have a solid grasp of how LXC is implemented and how to run production applications in a highly available and scalable way.
Table of Contents (17 chapters)
Containerization with LXC
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Connecting LXC to the host network


There are three main modes of connecting LXC containers to the host network:

  • Using a physical network interface on the host OS, which requires one physical interface on the host for each container

  • Using a virtual interface connected to the host software bridge using NAT

  • Sharing the same network namespace as the host, using the host network device in the container

The container configuration file provides the lxc.network.type option as we saw earlier in Table 5.1. Let's take a look at the available parameters for that configuration option:

Parameter

Description

none

The container will share the host's network namespace.

empty

LXC will create only the loopback interface.

veth

A virtual interface is created on the host and connected to interface inside the container's network namespace.

vlan

Creates a VLAN interface linked to the device specified with lxc.network.link. The VLAN ID is specified with the lxc.network.vlan.id option.

macvlan

Allows a single...