open vswitch 的基本用法

来源:互联网 发布:银行模拟教学软件 编辑:程序博客网 时间:2024/06/09 22:43

ovs-vswitchd 是主要模板
ovs-vsctl 用来查询和更新ovs-vswitchd的配置

添加网桥:
ovs-vsctl add-br br0
列出open vswitch中的所有网桥:
ovs-vsctl list-br
判断网桥是否存在:
ovs-vsctl br-exists br0
列出网桥中的所有端口:
ovs-vsctl list-ports br0
删除网桥上已经挂接的网口:
vs-vsctl del-port br0 eth0
查看open vswitch的网络状态:
ovs-vsctl show
将物理网卡挂接到网桥:
ovs-vsctl add-port br0 eth0
列出所有挂接到网卡的网桥:
ovs-vsctl port-to-br eth0
删除网桥:
ovs-vsctl del-br br0

可以实现
1.物理机与物理机之间相互连接,添加虚拟网桥绑定两块物理网卡,分别链接两台物理机
2.虚拟机与虚拟机之间相互连接,添加虚拟网桥绑定两个虚拟机的网卡

在虚拟交换机上添加一条vlan
Add an internal port vlan10 to bridge br0 as a VLAN access port for VLAN 10, and configure it with an IP address:
ovs-vsctl add-port br0 vlan10 tag=10 – set Interface vlan10 type=internal
ifconfig vlan10 192.168.0.123

0 0
原创粉丝点击