使用docker创建并启动三个容器,–net=none可以防止docker默认网桥影响连通性测试
docker run -itd –name con1 –net=none ubuntu:14.04 /bin/bash
docker run -itd –name con2 –net=none ubuntu:14.04 /bin/bash
docker run -itd –name con3 –net=none ubuntu:14.04 /bin/bash
创建网桥
ovs-vsctl add-br br0
给容器添加网卡,并挂载到br0上
ovs-docker add-port br0 eth0 con1 –ipaddress=10.10.1.2/24
ovs-docker add-port br0 eth0 con2 –ipaddress=10.10.1.3/24
ovs-docker add-port br0 eth0 con3 –ipaddress=10.10.1.4/24
查看网桥
ovs-vsctl show
登录con1进行连通性测试
设置vlan tag
查看网桥
查看interface
配置vlan tag
ovs-vsctl set port \”d6a13f4b3dc74_l\” tag=100
ovs-vsctl set port \”4ce7433a59984_l\” tag=100
ovs-vsctl set port \”1ce3bbfb62d44_l\” tag=200
登录con1进行连通性测试