ON THIS PAGE
Example: Creating a Transparent Service Chain by Using Contrail Command
This example provides step-by-step instructions to create a transparent service chain by using the Contrail Command user interface (UI).
Prerequisites
Hardware and Software Requirements
Hardware
Processor: 4 core x86
Memory: 32GB RAM
Storage: at least 128GB hard disk
Software
Contrail Release 3.2 or later
Note:For Contrail Networking Release 3.2 through Release 4.1, you use the Contrail Web UI. For more information, see Example: Creating a Transparent Service Chain by Using Contrail Web UI.
Create Network IPAM (IP Address Management)
Click Overlay>IPAM.
The IP Address Management page is displayed.
Click Create to create a new network IPAM.
Enter a name for the IPAM in the name field.
Select Default from the DNS list.
Enter valid IP address in the NTP Server IP field.
Enter domain name in the Domain Name field.
Click Create.
The IP Address Management page is displayed.
Overview
A service chain is a set of services that are connected across networks. A service chain consists of service instances, left and right virtual networks, and a service policy attached to the networks. A service chain can have in-network services, in-network-nat services, and transparent services. A transparent service chain is used for services that do not modify packets that are bridged between service instance interfaces. For more information, see Service Chaining.
Configuration
These topics provide instructions to create a transparent service chain.
- Create Primary Virtual Networks
- Create Secondary Virtual Network
- Create Service Virtual Machine
- Create Virtual Machine
- Configure Service Template
- Add Service Instance
- Create Service Policy
- Attach Service Policy
- Launch Virtual Machine
Create Primary Virtual Networks
Step-by-Step Procedure
Use the Contrail Command UI to create three primary virtual networks: left virtual network, right virtual network, and management virtual network. You attach service policies to the primary virtual networks that you create.
Follow these steps To create a left virtual network:
Click Overlay>Virtual Networks.
The All Networks page is displayed.
Click Create to create a network.
The Create Virtual Network page is displayed.
In the Name field enter test-left-VN for the left virtual network.
Select (Default) User defined subnet only from the Allocation Mode list.
Click +Add in the Subnets section to add subnets.
Step-by-Step Procedure
In the row that is displayed,
Select an IPAM for the virtual network from the Network IPAM list.
Enter 192.0.2.0/24 in the CIDR field.
Click Create.
The All Networks page is displayed. All virtual networks that you created are displayed in this page.
Note:Management network is not used to route packets. This network is used to help debug issues with the virtual machine.
Repeat steps 2 through 6 to create the right virtual network (test-right-VN) and management virtual network (test-mgmt-VN).
Create Secondary Virtual Network
Step-by-Step Procedure
Use the Contrail Command UI to create three secondary virtual networks: left virtual network (trans-left-VN), right virtual network (trans-right-VN, and management virtual network (trans-mgmt-VN. You associate the secondary virtual network to the transparent service instance that you create. For more information on creating virtual networks, see Create Primary Virtual Networks.
Create Service Virtual Machine
Step-by-Step Procedure
Follow these steps to create a service virtual machine (SVM) by using the Contrail Command UI.
Click Workloads > Instances.
The Instances page is displayed.
Click Create.
The Create Instance page is displayed.
Select Virtual Machine option button as the serve type.
Enter test-SVM in the Instance Name field.
Select Image as the boot source from the Select Boot Source list.
Note:vSRX image with M1.large flavor is recommended for in-network virtual machine.
Select vSRX image file from the Select Image list.
Select M1.large flavor from the Select Flavor list.
From the Available Networks table, select trans-left-VN, trans-right-VN, and trans-mgmt-VN networks that you want to associate with the SVM by clicking > next to the name of the virtual machine.
The network is added to the Allocated Networks table.
Select nova from the Availability Zone list.
Note:You can choose any other availability zone.
Select 5 from the Count (1-10) list.
Note:You can choose any value from 1 through 10.
Click Create to launch the left virtual machine instance.
The Instances page is displayed. The virtual machine instances that you created are listed on the Instances page.
Create Virtual Machine
Step-by-Step Procedure
Follow these steps to create a left virtual machine by using the Contrail Command UI.
Click Workloads > Instances.
The Instances page is displayed.
Click Create.
The Create Instance page is displayed.
Select Virtual Machine option button as the serve type.
Enter test-left-VM for the left virtual machine in the Instance Name field.
Select Image as the boot source from the Select Boot Source list.
Note:vSRX image with M1.large flavor is recommended for in-network virtual machine.
Select vSRX image file from the Select Image list.
Select M1.large flavor from the Select Flavor list.
From the Available Networks table, select test-left-VN network that you want to associate with the left virtual machine by clicking > next to the name of the virtual machine.
For the right virtual machine, select test-right-VN.
The network is added to the Allocated Networks table.
Select nova from the Availability Zone list.
Note:You can choose any other availability zone.
Select 5 from the Count (1-10) list.
Note:You can choose any value from 1 through 10.
Click Create to launch the left virtual machine instance.
The Instances page is displayed. The virtual machine instances that you created are listed on the Instances page.
Repeat steps 2 through 11 to create right virtual machine instance (test-right-VM).
Configure Service Template
Step-by-Step Procedure
Follow these steps to create a service template by using the Contrail Command UI:
Click Services>Catalog.
The VNF Service Templates page is displayed.
Click Create.
The Create VNF Service Template page is displayed.
Enter test-service-template in the Name field.
Select v2 as the version type.
Note:Starting with Release 3.2, Contrail supports only Service Chain Version 2 (v2).
Select Virtual Machine as the virtualization type.
Select Transparent as the service mode.
Select Firewall as the service type.
From the Interface section,
Select left as the interface type from the Interface Type list.
Click + Add.
The Interface Type list is added to the table.
Select right as the interface type.
Click + Add again.
Another Interface Type list is added to the table.
Select management as the interface type.
Note:The interfaces created on the virtual machine must follow the same sequence as that of the interfaces in the service template.
Click Create to create the service template.
The VNF Service Templates page is displayed. The service template that you created is displayed in the VNF Service Templates page.
Add Service Instance
Step-by-Step Procedure
Follow these steps to add a service instance by using the Contrail Command UI:
Click Services>Deployments.
The VNF Service Instances page is displayed.
Click Create.
The Create VNF Service Instance page is displayed.
Enter test-service-instance in the Name field.
Select test-service-template - [transparent, (left, right, management)] - v2 from the Service Template list.
The Interface Type and Virtual Network fields are displayed.
Select the virtual network for each interface type as given below.
left—Select trans-left-VN virtual network that you created.
right—Select the trans-right-VN virtual network that you created.
management—Select the trans-mgmt-VN virtual network that you created.
Click the Port Tuples section and click +Add.
Select the virtual machine instance for each interface type as given below. The port tuples should match the interfaces of the SVM. See Create Service Virtual Machine.
left—Select the left virtual machine instance that you created.
right—Select the right virtual machine instance that you created.
management—Select the management virtual machine instance that you created.
Click Create to create the service instance.
The VNF Service Instances page is displayed. The service instance that you created is displayed in the VNF Service Instances page.
Create Service Policy
Step-by-Step Procedure
Follow these steps to create a service policy by using the Contrail Command UI.
Click Overlay > Network Policies.
The Network Policies page is displayed.
Click Create.
The Network Policy tab of the Create Network Policy page is displayed.
Enter test-network-policy in the Policy Name field.
In the Policy Rule(s) section,
Select pass from the Action list.
Select ANY from the Protocol list.
Select Network from the Source Type list.
Select the test-left-VN from the Source list.
In the Source Port field, leave the default option, Any, as is.
Select < > from the Direction list.
Select Network from the Destination Type list.
Select the test-right-VN from the Destination list.
In the Destination Ports field, leave the default option, Any, as is.
Click Create to create the service policy.
The Network Policies page is displayed. All policies that you created are displayed in the Network Policies page.
Attach Service Policy
Step-by-Step Procedure
Follow these steps to attach a service policy:
Click Overlay>Virtual Networks.
The All networks page is displayed.
Select the test-left-VN network that you want to edit, and click the Edit icon.
The Edit Virtual Network page is displayed.
Note:For the right virtual network, edit test-right-VN.
Select test-network-policy from the Network Policies list.
Click Save to save the changes.
The Virtual Networks page is displayed.
Repeat steps 2 through 4 to attach the service policy to test-right-VN.