Zachary Miller
Zachary Miller

Reputation: 189

How to add a port to an OpenFlow bridge

I am currently using Open vSwitch to try to build a networking application. I had used mininet and was able to create basic topologies easily. I tried to replicate that without using mininet and I ran into problems configuring my switch.

When I attempt to add a port to my switch, it appears to add correctly to the Open vSwitch bridge, but does not show up with the OpenFlow controller. How do I correctly add a port to an OpenFlow switch using Open vSwitch? Here is what I have tried so far:

$ sudo ifconfig lo:1 10.0.0.1 $ sudo ovs-vsctl add-br switch $ sudo ovs-vsctl add-port switch lo:1 $ sudo ovs-vsctl show 7c625407-3eae-40d1-9dca-94307331790e Bridge switch Port switch Interface switch type: internal Port "lo:1" Interface "lo:1" ovs_version: "1.9.0" $ sudo ovs-ofctl show switch OFPT_FEATURES_REPLY (xid=0x1): dpid:0000566c1450f749 n_tables:255, n_buffers:256 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ... actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN ... LOCAL(switch): addr:56:6c:14:50:f7:49 config: PORT_DOWN state: LINK_DOWN speed: 100 Mbps now, 100 Mbps max OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0

How can I add a port so that it shows up using the OpenFlow controller?

Upvotes: 1

Views: 5695

Answers (2)

Zachary Miller
Zachary Miller

Reputation: 189

In order to add a port to the OpenFlow bridge I had to specify the OpenFlow port number of the port. I had to make a slight modification to the add-port command.

Before:

$ sudo ovs-vsctl add-port <bridge> <port name>

After:

Note: n is the OpenFlow port number of the port to be added

For versions of Open vSwitch <=1.9:

$ sudo ovs-vsctl add-port <bridge> <port name> -- set Interface <port name> ofport=n

For versions of Open vSwitch >1.9:

$ sudo ovs-vsctl add-port <bridge> <port name> -- set Interface <port name> ofport_request=n

Upvotes: 1

user3771522
user3771522

Reputation: 331

You forgot to add the controller to your network. So just set it :

ovs-vsctl set-controller switch tcp:controller_address

You can read the ovs-vsctl manual for more information

Upvotes: 0

Related Questions