您的位置:首页 > 运维架构

OpenVSwitch简单容易入门

2015-06-08 13:36 190 查看


OVS… its simple really!

It’s taken me almost a week to figure out how they expect the OVS networking to work, and no one explains its simple. So heres a 30 second explanation that will actually make sense.

You have 3 openvswitch bridges, br-int, br-ex and br-tun.

The VM all get ports on br-int, br-ex is used for actual network traffic and br-tun is used for the tunnel interfaces between instances.

OpenVSwitch creates flow rules with virtual patch cables between br-ex and br-int to provide connectivity.

Add your physical interfaces to br-ex, create a management port with type internal so linux can add ips to it. In the below example we use load balancing to combine 2 nics for redundancy.




Commands to build this configuration:

ovs-vsctl add-br br-ex

ovs-vsctl add-br br-int

ovs-vsctl add-br br-tun

ovs-vsctl add-bond br-ex bond0 em1 em2 — set port bond0 bond_mode=balance-slb

ovs-vsctl add-port br-ex mgmt tag=15 — set interface mgmt type=internal


What it should look like:

[root@s2138 ~]# ovs-vsctl show

0646ec2b-3bd3-4bdb-b805-2339a03ad286

Bridge br-ex

Port “team0″

Interface “team0″

Port br-ex

Interface br-ex

type: internal

Port mgmt

tag: 15

Interface mgmt

type: internal

Port “bond0″

Interface “em1″

Interface “em2″

Port mgmt-temp

tag: 2003

Interface mgmt-temp

type: internal

Bridge br-int

fail_mode: secure

Port br-int

Interface br-int

type: internal

Bridge br-tun

Port br-tun

Interface br-tun

type: internal
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: