open vswitch常用操作

以下操作都需要root权限运行,在所有命令中br0表示网桥名称,eth0为网卡名称。

添加网桥:

#ovs-vsctl add-br br0

列出open vswitch中的所有网桥:

#ovs-vsctl list-br

判断网桥是否存在

#ovs-vsctl br-exists br0

将物理网卡挂接到网桥:

#ovs-vsctl add-port br0 eth0

列出网桥中的所有端口:

#ovs-vsctl list-ports br0

列出所有挂接到网卡的网桥:

#ovs-vsctl port-to-br eth0

查看open vswitch的网络状态:

 #ovs-vsctl show

删除网桥上已经挂接的网口:

#vs-vsctl del-port br0 eth0

删除网桥:

#ovs-vsctl del-br br0
原文地址:https://www.cnblogs.com/dpf-10/p/5622353.html