==== How to configure L2 Network with Single Controller ===== Overview This example provides the procedure to demonstrate configuration of VTN Coordinator with L2 network using VTN Virtualization(single controller). Here is the Example for vBridge Interface Mapping with Single Controller using mininet. mininet details and set-up can be referred at below URL: https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet .EXAMPLE DEMONSTRATING SINGLE CONTROLLER image::vtn/vtn-single-controller-topology-example.png[EXAMPLE DEMONSTRATING SINGLE CONTROLLER] ===== Requirements * Configure mininet and create a topology: ---- mininet@mininet-vm:~$ sudo mn --controller=remote,ip= --topo tree,2 ---- * mininet> net ---- s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0 h1 h1-eth0:s1-eth1 h2 h2-eth0:s2-eth2 ---- ===== Configuration * Create a Controller named controllerone and mention its ip-address in the below create-controller command. ---- curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json ---- * Create a VTN named vtn1 by executing the create-vtn command ---- curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json ---- * Create a vBridge named vBridge1 in the vtn1 by executing the create-vbr command. ---- curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json ---- * Create two Interfaces named if1 and if2 into the vBridge1 ---- curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json ---- ---- curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json ---- * Get the list of logical ports configured ---- Curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json ---- * Configure two mappings on each of the interfaces by executing the below command. The interface if1 of the virtual bridge will be mapped to the port "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected to the port "s2-eth1". The interface if2 of the virtual bridge will be mapped to the port "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected to the port "s3-eth1". ---- curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json ---- ===== Verification Please verify whether the Host1 and Host3 are pinging. * Send packets from Host1 to Host3 ---- mininet> h1 ping h3 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data. 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms ----