7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

bridge、2つのIP設定、macvlan

Last updated at Posted at 2013-09-04

bridge

/etc/network/interface
auto br0
iface br0 inet static
	address 192.168.100.61
	netmask 255.255.255.0
	gateway 192.168.100.1
	dns-nameservers 8.8.8.8 8.8.4.4
	#
	bridge_ports enp2s0
	bridge_maxwait 0
	bridge_df 0
	bridge_stp off
$ brctl show
bridge name	bridge id		STP enabled	interfaces
br0			8000.000000000000	no		enp2s0
docker0		8000.000000000000	no		
lxcbr0		8000.000000000000	no		
virbr0		8000.000000000000	yes		virbr0-nic

IP2つ目割り当て

eth0と同じmacアドレスでeth0:0を作成

作成
$ ifconfig eth0:0 192.168.11.99/24
削除
ifconfig eth0:0 down

/etc/network/interfaces

/etc/network/interfaces
 iface eth0:0 inet static
 	address 192.168.11.99
 	netmask 255.255.255.0

仮想NIC

eth0と違うmacアドレスでmacvlan0を作成

作成
$ sudo ip link add dev macvlan0 link eth0 type macvlan
$ sudo ifconfig macvlan0 up
$ sudo dhclient macvlan0
  • Centos5.8だとUbuntuとip コマンドオプションが異なる様子。
削除
$ sudo ifconfig macvlan0 down
$ sudo ip link del dev macvlan0

/etc/network/interfaces

/etc/network/interfaces
iface macvlan0 inet static
  address 192.168.11.98
  netmask 255.255.255.0
  pre-up ip link add macvlan0 link eth0 type macvlan

lxc

/var/lib/lxc//config
lxc.network.type=macvlan
lxc.network.macvlan.mode=bridge
lxc.network.link=eth0
lxc.network.flags=up
lxc.network.name=eth0
7
6
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
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?