Implementing Unidirectional and Bidirectional VirtualWire Links
In this section you can configure a single bidirectional VirtualWire link using the port-association-create command with the option virtual-wire . Each port of the VirtualWire transmits traffic in full-duplex mode.
Use the port-association-create command:
CLI(network-admin@Spine1) > port-association-create name name-string master-ports port-list slave-ports port-list virtual-wire|no-virtual-wire
port-association-create |
Creates a port association between the master and slave ports. |
name name-string |
Specify the name of the configuration |
master-ports port-list |
Specify the master port number or a list of ports that can act as master ports. |
slave-ports port-list |
Specify the slave port number or a list of ports that can act as salve ports. |
[virtual-wire|no-virtual-wire] |
Specify the virtual-wire keyword to form a virtual-wire port association. This command keyword creates two vFlows between the master and slave ports and re-directs all traffic from one port to another by creating a pseudo wire. It also creates a flow policy with Copy-to-CPU action on TCP packets (sync, ack, and rst) to provide analytics with tracking details. This keyword is available only when the switch is in VirtualWire mode. |
Configuring a single bidirectional VirtualWire link using the port-association-create command with the option virtual-wire can be implemented in two ways that are functionally equivalent:
- Configuring VirtualWire direction individually - or
- Configuring a VirtualWire link using the bidir parameter
To configure a unidirectional VirtualWire link from device A to device B, enter the following command:
CLI (network-admin@Leaf1) > port-association-create name A-to-B virtual-wire master-ports 10 slave-ports 20 no-bidir
REST API Command: curl -u network-admin:test123 -X POST http://<switch-ip>/vRest/port-associations -d '{"name": "A-to-B","virtual-wire":true,"master-ports": "10","slave-ports": "20"}' -H "Content-Type: application/json"
Note: Please note that the parameter virtual-wire must be set to “true”. This is the case when the switch is running in VirtualWire mode and you are configuring VirtualWire features.
To configure a unidirectional Virtual Wire link from device B to device A, enter the following command:
CLI (network-admin@Leaf1) > port-association-create name B-to-A virtual-wire master-ports 20 slave-ports 10
Note: If the bidir|no-bidir keywords are not mentioned in the above command, then by default a uni-directional association of VirtualWire link is configured.
REST API Command: curl -u network-admin:test123 -X POST http://<switch-ip>/vRest/port-associations -d '{"name": "B-to-A","virtual-wire": true,"master-ports": "20","slave-ports": "10"}' -H "Content-Type: application/json"
To configure a bidirectional Virtual Wire link from device A to device B, enter the following command:
CLI (network-admin@Leaf1) > port-association-create name A-to-B bidir virtual-wire master-ports 10 slave-ports 20
REST API Command: curl -u network-admin:test123 -X POST http://<switch-ip>/vRest/port-associations -d '{"name": "A-to-B","bidir": true,"virtual-wire": true,"master-ports": "10","slave-ports": "20"}' -H "Content-Type: application/json"
To display existing Virtual Wire links, use the port-association-show command:
CLI (network-admin@Leaf1) > port-association-show
switch name master-ports slave-ports policy virtual-wire bidir
--------- ------ ------------ ----------- ----------- ------------ -----
vw-switch A-to-B 10 20 all-masters true true
REST API Command: curl -u network-admin:test123 -X GET http://<switch-ip>/vRest/port-associations
To delete an existing Virtual Wire link, use the port-association-delete command with the name string parameter:
CLI (network-admin@Leaf1) > port-association-delete name A-to-B
REST API Command: curl -u network-admin:test123 -X DELETE http://<switch-ip>/vRest/port-associations/A-to-B