2

I am trying to install the LXC and LXC container on a new HP server with Centos 6.8, using the article "Introduction to Containers on Linux using LXC".

Steps which I executed.

yum update
yum install libcap-devel libcgroup busybox wget bridge-utils
yum groupinstall "Development tools"

chkconfig cgconfig on
service cgconfig start

And downloaded and installed lxc

# install lxc
wget https://linuxcontainers.org/downloads/lxc-2.0.6.tar.gz
tar zxvf lxc-2.0.6.tar.gz
cd lxc-2.0.6
./configure
make && make install

Where I stopped

Now I need to create a bridge for sharing the network to the containers. But when I checked my server, I can see there is no ifcfg-eth* files present in the path /etc/sysconfig/network-scripts.
When I checked the network status, I can see

[root@server /]# service network status
Configured devices:
lo
Currently active devices:
lo eth0 eth1 eth2 eth3

Even ifconfig command shows that the IP address is configured in eth0.

How do I configure the bridge now, if the file is missing?
Also I need to know how to set the disk space of the new containers created...

2
  • Welcome (out) on SuperUser. :-) A general suggestion: report the steps of the article and write the last step(s) you have executed in that list. As your question is now you are requiring to the potential answerer to read all the article (and the link has to be active) in order to try to understand what you have done and which should be your problem... too much time--> few audience --> few answers ;-). Good luck. ps> you can edit your question...
    – Hastur
    Commented Jan 23, 2017 at 5:56
  • Good work... just added some sections to allow to jump where the people want. Again:good luck.
    – Hastur
    Commented Jan 23, 2017 at 9:43

1 Answer 1

0

I finally figured out on this.

If interface files are not present, we can create the interface files like ifcfg-eth0, ifcfg-br0 etc. Add corresponding values to the file.

During the bridge configuration,

  • For bridge interface (br0) you need to mention the actual Hardware Address, disable NetworkManager control and enable the onboot.
  • For ethernet interface (eth0), you need to mention a different Hardware Address (last digit can be changed), disable NetworkManager control and enable the onboot.

Example configuration

ifcfg-br0
=========
DEVICE=br0
TYPE=Bridge
GATEWAY=192.168.1.1
HWADRESS=00:1C:23:59:5A:92
IPADDR=192.168.1.109
#NETMASK=255.255.255.0
ONBOOT=yes
#BOOTPROTO=dhcp
NM_CONTROLLED=no
DELAY=0

ifcfg-eth0
==========
DEVICE=eth0
TYPE=Ethernet
HWADRESS=00:1C:23:59:5A:93
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0

you can create a shell script and run it in nohup mode.

$ echo  "service network restart" > restart_network.sh
$ chmod u+x restart_network.sh
$ nohup ./restart_network.sh &

I was able to configure the bridge network on multiple physical servers without the network getting disconnected. I did not have console or physical access to server, but used only remote connection via ssh.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .