Ovs as a router

asked 2016-12-20 18:08:00 -0500

fifi gravatar image

I need to connect two openstack clusters via a router. I use a pc with 3 Ethernet ports and install openvswitch on it. I created an ovs bridge, got it connected to a sdn controller using eth0. I also added the other two physical Ethernet ports to this bridge. Now my ovs bridge has 4 ports naming local, eth0, eth1 and eth2. I need to route traffic between eth1 and eth2. I also added some flow rules for default routing. I just don't know how to assign two ips addresses to the ovs bridge at the same time(for eth1 and eth2). Do I need to use two seperate ovs for each Ethernet port?

edit retag flag offensive close merge delete


Don't know what you want indeed. If you want two os-clusters communicate with each, I assume, you can simple use floating ip and configura three-layer routing policy for the two clusters. There is no need to use ovs and linux network can do this well.

zhangqibm gravatar imagezhangqibm ( 2016-12-21 03:19:55 -0500 )edit

This is an experiment for the role of SDN in wm migration between two layer3 domains. This is why I need to do that in a way I explained. I know there are many easier way to do that but I have to do it as I explained before

fifi gravatar imagefifi ( 2016-12-21 11:08:16 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2016-12-22 02:59:45 -0500

silently gravatar image

updated 2016-12-22 03:00:32 -0500

[root@vm20 source]# ifconfig ens12:1 netmask 

[root@vm20 source]# ifconfig ens12
ens12: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fe80::4b65:8ac3:b64:e09c  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:ec:11:49  txqueuelen 1000  (Ethernet)
        RX packets 24  bytes 3677 (3.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 34  bytes 4931 (4.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 84

[root@vm20 source]# ifconfig ens12:1
ens12:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        ether 52:54:00:ec:11:49  txqueuelen 1000  (Ethernet)

does this fir requirementing ?
edit flag offensive delete link more

answered 2016-12-21 10:00:04 -0500

Asm0deus gravatar image

updated 2016-12-21 10:02:36 -0500

OVS is simply not a router. It lacks L3 interfaces and IP protocols.

You'll need a VM instance (or logical interfaces on the local Linux stack) to act as your vRouter. There are many free/open-source and commercial options for this function, but perhaps the easiest (yet feature-poor) option is to eliminate OVS completely and just use native Linux Bridging, which allows you to add IP numbering to your bridge interfaces.

Here is a VERY simple example in Ubuntu Server 14.04 LTS:

auto br0
iface br0 inet static
        bridge_ports em1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
        up /sbin/ifconfig $IFACE up || /bin/true

You can add multiple physical interfaces to this same bridge, but based on your description you likely want two separate bridge interfaces, each associated with a different physical interface, each with its own IP address.

Routing is a larger conversation. Note that you'll only want ONE bridge with a default route, normally. Hosts/VMs on either side will need to know the route to the other side/subnet via static routes, or perhaps their def.gwy host will handle that static route for them. Again, this is a larger/different conversation.

edit flag offensive delete link more


Thanks for your answer. As I mentioned, I got my ovs bridge connected to a SDN controller which supports routing for my purpose. My problem is that how I can add those two ports to ovs bridge, because OVS can hold one of the port IPs at a time

fifi gravatar imagefifi ( 2016-12-21 10:51:27 -0500 )edit

another solution I tested is using two OVS bridges. Both bridges are connected to one controller. Each bridge is in charge of one ethernet port and I use ip forwarding in linux kernel to route between two OVS bridges

fifi gravatar imagefifi ( 2016-12-21 10:54:00 -0500 )edit

For some reasons, I don't wanna use that solution. I want to use just one OVS bridge which is connected to a SDN controller with routing support. Then that OVS bridge is in charge of both ethernet ports and route traffic between them. I need help for implementing this solution

fifi gravatar imagefifi ( 2016-12-21 10:56:46 -0500 )edit

Yes, like Asm0deus mentioned above ovs act as layer2 device and you want ovs as router is not a good idea I think. In another hand, you want two openstack clusters can "migrate" vms to each other. This should be supported by both nova and neutron. I asume you need hack to openstack source code.

zhangqibm gravatar imagezhangqibm ( 2016-12-22 03:02:24 -0500 )edit

When I use SDN controller, OVS would act as an data forwarding device only. I'm not using OVS as a stand alone switch. Migrating VM between two layer 3 domains is possible in openstack without hacking into the source code. This is something normally done in virtual datacenters.

fifi gravatar imagefifi ( 2016-12-22 11:56:33 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-12-20 18:08:00 -0500

Seen: 1,099 times

Last updated: Dec 22 '16