Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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

  • Create Network IPAM (IP Address Management)

    1. Click Overlay>IPAM.

      The IP Address Management page is displayed.

    2. Click Create to create a new network IPAM.

    3. Enter a name for the IPAM in the name field.

    4. Select Default from the DNS list.

    5. Enter valid IP address in the NTP Server IP field.

    6. Enter domain name in the Domain Name field.

    7. 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

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:

  1. Click Overlay>Virtual Networks.

    The All Networks page is displayed.

  2. Click Create to create a network.

    The Create Virtual Network page is displayed.

  3. In the Name field enter test-left-VN for the left virtual network.

  4. Select (Default) User defined subnet only from the Allocation Mode list.

  5. Click +Add in the Subnets section to add subnets.

    Step-by-Step Procedure

    In the row that is displayed,

    1. Select an IPAM for the virtual network from the Network IPAM list.

    2. Enter 192.0.2.0/24 in the CIDR field.

  6. 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.

  1. Click Workloads > Instances.

    The Instances page is displayed.

  2. Click Create.

    The Create Instance page is displayed.

  3. Select Virtual Machine option button as the serve type.

  4. Enter test-SVM in the Instance Name field.

  5. 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.

  6. Select vSRX image file from the Select Image list.

  7. Select M1.large flavor from the Select Flavor list.

  8. 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.

  9. Select nova from the Availability Zone list.

    Note:

    You can choose any other availability zone.

  10. Select 5 from the Count (1-10) list.

    Note:

    You can choose any value from 1 through 10.

  11. 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.

  1. Click Workloads > Instances.

    The Instances page is displayed.

  2. Click Create.

    The Create Instance page is displayed.

  3. Select Virtual Machine option button as the serve type.

  4. Enter test-left-VM for the left virtual machine in the Instance Name field.

  5. 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.

  6. Select vSRX image file from the Select Image list.

  7. Select M1.large flavor from the Select Flavor list.

  8. 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.

  9. Select nova from the Availability Zone list.

    Note:

    You can choose any other availability zone.

  10. Select 5 from the Count (1-10) list.

    Note:

    You can choose any value from 1 through 10.

  11. 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:

  1. Click Services>Catalog.

    The VNF Service Templates page is displayed.

  2. Click Create.

    The Create VNF Service Template page is displayed.

  3. Enter test-service-template in the Name field.

  4. Select v2 as the version type.

    Note:

    Starting with Release 3.2, Contrail supports only Service Chain Version 2 (v2).

  5. Select Virtual Machine as the virtualization type.

  6. Select Transparent as the service mode.

  7. Select Firewall as the service type.

  8. 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.

  9. 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:

  1. Click Services>Deployments.

    The VNF Service Instances page is displayed.

  2. Click Create.

    The Create VNF Service Instance page is displayed.

  3. Enter test-service-instance in the Name field.

  4. Select test-service-template - [transparent, (left, right, management)] - v2 from the Service Template list.

    The Interface Type and Virtual Network fields are displayed.

  5. 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.

  6. 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.

  7. 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.

  1. Click Overlay > Network Policies.

    The Network Policies page is displayed.

  2. Click Create.

    The Network Policy tab of the Create Network Policy page is displayed.

  3. Enter test-network-policy in the Policy Name field.

  4. 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.

  5. 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:

  1. Click Overlay>Virtual Networks.

    The All networks page is displayed.

  2. 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.

  3. Select test-network-policy from the Network Policies list.

  4. 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.

Launch Virtual Machine