Adding bridge interface for lxc containers

by

in

You can make a bridge by changing network configuration file:

# cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
# iface eth0 inet dhcp

# make this manual, that network manager would not conflict when you connect utp cable
iface eth0 inet manual

auto br0
iface br0 inet static
	bridge_ports eth0
	address 192.168.1.10
	broadcast 192.168.1.255
	netmask 255.255.255.0
	gateway 192.168.1.1

In this configuration I used br0 static configuration.
If You need dhcp, You can use this configuration:

# cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
# iface eth0 inet dhcp

# make this manual, that network manager would not conflict when you connect utp cable
iface eth0 inet manual

auto br0
iface br0 inet dhcp

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.