安装

yum源

[nux-misc]
name=Nux Misc
baseurl=http://li.nux.ro/download/nux/misc/el7/x86_64/
enabled=0
gpgcheck=1
gpgkey=http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

安装

yum --enablerepo=nux-misc install tunctl

创建虚拟网卡设备

# 创建
tunctl -t tap0

# 删除
tunctl -d tap0

设置虚拟网卡


# 配置ip 和 mac
ifconfig tap0 172.66.4.2  netmask 255.255.255.0
ifconfig tap0 hw ether 04:ac:10:ff:35:06

# 启动
ip link set tap0 up

添加到网桥

# 创建网桥
ovs-vsctl add-br ovs0

# 将tap0添加到ovs0
ovs-vsctl add-port ovs0 tap0 -- set interface tap0 external_ids:container_id=vm1

# 删除端口
ovs-vsctl del-port tap0

manshu
65 声望9 粉丝

clear is better than clever