FutureNet
NXR,WXRシリーズ
LXC編
2. LXC設定(マルチコンテナ対応機種)
2-2. ホスト側の設定(LXC)
コンテナはホスト上のブリッジを介して外部と通信できます。コンテナ内部のネットワークとホスト側のブリッジをつなぐ場合は、仮想インタフェース「veth」を使用します。
【対象機種】NXR-G200シリーズ
【 ネットワーク構成 】
- 使用するルートファイルシステムが保存されたディレクトリ名を「ubuntu-14.04.5-armhf」とします。
【 設定例 】
nxrg240#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
nxrg240(config)#interface bridge 0
nxrg240(config-bridge)#ip address 192.168.10.1/24
nxrg240(config-bridge)#exit
nxrg240(config)#interface ethernet 0
nxrg240(config-if)#no ip address
nxrg240(config-if)#bridge-group 0 port 1
nxrg240(config-if)#exit
nxrg240(config)#lxc container 1
nxrg240(config-lxc)#mount rootfs disk1:/ubuntu-14.04.5-armhf
nxrg240(config-lxc)#exit
nxrg240(config)#interface veth 0
nxrg240(config-veth)#lxc-link 1
nxrg240(config-veth)#bridge-group 0 port 2
nxrg240(config-veth)#exit
nxrg240(config)#exit
nxrg240#save config
Enter configuration commands, one per line. End with CNTL/Z.
nxrg240(config)#interface bridge 0
nxrg240(config-bridge)#ip address 192.168.10.1/24
nxrg240(config-bridge)#exit
nxrg240(config)#interface ethernet 0
nxrg240(config-if)#no ip address
nxrg240(config-if)#bridge-group 0 port 1
nxrg240(config-if)#exit
nxrg240(config)#lxc container 1
nxrg240(config-lxc)#mount rootfs disk1:/ubuntu-14.04.5-armhf
nxrg240(config-lxc)#exit
nxrg240(config)#interface veth 0
nxrg240(config-veth)#lxc-link 1
nxrg240(config-veth)#bridge-group 0 port 2
nxrg240(config-veth)#exit
nxrg240(config)#exit
nxrg240#save config
【 設定例解説 】
1. <bridge0インタフェース設定>
nxrg240(config)#interface bridge 0
nxrg240(config-bridge)#ip address 192.168.10.1/24
nxrg240(config-bridge)#ip address 192.168.10.1/24
bridge0インタフェースのIPアドレスを設定します。
2. <ethernet0インタフェース設定>
nxrg240(config)#interface ethernet 0
nxrg240(config-if)#no ip address
nxrg240(config-if)#no ip address
ethernet0インタフェースのIPアドレスを無効にします。
nxrg240(config-if)#bridge-group 0 port 1
ブリッジグループを設定します。
(☞) ブリッジグループの番号はbridgeインタフェースの番号と同一のものを設定します。またポートはブリッジグループ内でユニークなものを設定する必要があります。
3. <LXCコンテナ設定>
nxrg240(config)#lxc container 1
LXCコンテナを設定します。
nxrg240(config-lxc)#mount rootfs disk1:/ubuntu-14.04.5-armhf
「ubuntu-14.04.5-armhf」ディレクトリに保存されているルートファイルシステムをマウントするように設定します。
4. <veth0インタフェース設定>
nxrg240(config)#interface veth 0
veth0インタフェースを設定します。
nxrg240(config-veth)#lxc-link 1
lxc container1との仮想ブリッジを設定します。
nxrg240(config-veth)#bridge-group 0 port 2
ブリッジグループを設定します。
【 補足 】
コンテナの動作状態はshow lxcコマンドで確認することができます。
nxrg240#show lxc
Name: c1
State: RUNNING
PID: 6763
CPU use: 3.11 seconds
Name: c1
State: RUNNING
PID: 6763
CPU use: 3.11 seconds
目次
更新情報
→ 一覧へカテゴリ
タグ
- 203
- CRG
- DDNS
- DHCP
- DNAT
- DNSインターセプト
- DS-Lite
- Ethernet
- IIJモバイル
- IKE Modeconfig
- IKEv2 Configuration Payload
- IPinIP
- IPoE
- IPv6
- KDDI
- L2TP/IPsec
- L2TPv3
- LXC
- MAP-E
- NGN
- NTTドコモ
- PBR
- Policy Based IPsec
- PPP
- PPPoE
- RADIUS連携
- RAシリーズ
- Route Based IPsec
- SMS
- SNAT
- SoftBank
- UPnP
- URL転送
- VLAN
- VRRP
- Web認証
- WiMAX
- ファームウェア
- フィルタ
- ブリッジ
- モニタログ
- ワイモバイル
- 仮想スイッチ
- 冗長化
- 無線LAN