1 ==== How to configure L2 Network with Single Controller
5 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:
6 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
8 .EXAMPLE DEMONSTRATING SINGLE CONTROLLER
9 image::vtn/vtn-single-controller-topology-example.png[EXAMPLE DEMONSTRATING SINGLE CONTROLLER]
13 * Configure mininet and create a topology:
16 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
22 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
23 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
30 * Create a Controller named controllerone and mention its ip-address in the below create-controller command.
33 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
36 * Create a VTN named vtn1 by executing the create-vtn command
38 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
41 * Create a vBridge named vBridge1 in the vtn1 by executing the create-vbr command.
44 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
47 * Create two Interfaces named if1 and if2 into the vBridge1
51 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
56 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
59 * Get the list of logical ports configured
62 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
64 * Configure two mappings on each of the interfaces by executing the below command.
66 The interface if1 of the virtual bridge will be mapped to the port "s2-eth1" of the switch "openflow:2" of the Mininet.
67 The h1 is connected to the port "s2-eth1".
69 The interface if2 of the virtual bridge will be mapped to the port "s3-eth1" of the switch "openflow:3" of the Mininet.
70 The h3 is connected to the port "s3-eth1".
73 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
74 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
79 Please verify whether the Host1 and Host3 are pinging.
81 * Send packets from Host1 to Host3
85 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
86 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
87 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms