LoginSignup
1
2

More than 5 years have passed since last update.

LXCでbridge接続

Last updated at Posted at 2015-02-08

概要

macmini.JPG

ネットワーク設定

bond0

/etc/netctl/bond0
Description='Bond0 Interface'
Interface='bond0'
Connection=bond
BindsToInterfaces=(enp3s0f0)
/etc/modprobe.d/bonding.conf
options bonding miimon=100
options bonding mode=active-backup
netctl enable bond0

br0

/etc/netctl/br0
Interface=br0
Connection=bridge
BindsToInterfaces=(bond0)
IP=static
Address=('192.168.100.2/24')
Gateway='192.168.100.1'
DNS=('8.8.8.8' '8.8.4.4')
netctl enable br0

再起動しとく。

lxc

lxc-create -n centos7 -t centos -- -R 7
/var/lib/lxc/centos7/config
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 192.168.100.4/24
lxc.network.ipv4.gateway = 192.168.100.1
lxc.network.name = eth0
lxc-start -n centos7
lxc-attach -n centos7

インターネットに出られることを確認。

br1を追加

br1を作って以下を追記すれば行けるんじゃないかな

/var/lib/lxc/centos7/config
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br1
lxc.network.ipv4 = 192.168.0.4/24
lxc.network.name = eth1
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2