Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Using Static Routes with Services

Static Routes for Service Instances

Static routes can be configured in a virtual network to direct traffic to a service virtual machine.

The following figure shows a virtual network with subnet 10.1.1.0/24. All of the traffic from a virtual machine that is directed to subnet 11.1.1.0/24 can be configured to be routed by means of a service machine, by using the static route 11.1.1.252 configured on the service virtual machine interface.

Network topology diagram showing three compute nodes with virtual machines. VM1 on Compute Node 1 has IP 10.1.1.251; VM2 on Compute Node 2 has IP 10.1.1.252; Service VM on Compute Node 3 has IP 10.1.1.253. VM1 connects to VM2 via IP 10.1.1.252 and to Service VM via IP 11.1.1.252.

Configuring Static Routes on a Service Instance

To configure static routes on a service instance, first enable the static route option in the service template to be used for the service instance.

To enable the static route option in a service template:

  1. Go to Configure > Services > Service Templates and click Create.
  2. At Add Service Template, complete the fields for Name, Service Mode, and Image Name.
  3. Select the Interface Types to use for the template, then for each interface type that might have a static route configured, click the check box under the Static Routes column to enable the static route option for that interface.

    The following figure shows a service template in which the left and right interfaces of service instances have the static routes option enabled. Now a user can configure a static route on a corresponding interface on a service instance that is based on the service template shown.

Configuration window for adding a service template in a network tool. Fields include Name, Service Mode, Image Name, Interface Types with Shared IP and Static Routes options, and Advanced Options. Action buttons are Cancel and Save.

Configuring Static Routes on Service Instance Interfaces

To configure static routes on a service instance interface:

  1. Go to Configure > Services > Service Instances and click Create.
  2. At Create Service Instances, complete the fields for Instance Name and Services Template.
  3. Select the virtual network for each of the interfaces
  4. Click the Static Routes dropdown menu under each interface field for which the static routes option is enabled to open the Static Routes menu and configure the static routes in the fields provided.
    Note:

    If the Auto Configured option is selected, traffic destined to the static route subnet is load balanced across service instances.

The following figure shows a configuration to apply a service instance between VN1 (10.1.1.0/24) and VN2 (11.1.1.0/24). The left interface of the service instance is configured with VN1 and the right interface is configured to be VN2 (11.1.1.0/24). The static route 11.1.1.0/24 is configured on the left interface, so that all traffic from VN1 that is destined to VN2 reaches the left interface of the service instance.

Configuration window for creating a service instance named nat using a predefined template. Contains fields for interfaces management, left set to vn1, and right set to vn2. Static route with prefix 11.1.1.0/24 added. Options to cancel or save.

The following figure shows static route 10.1.1.0/24 configured on the right interface, so that all traffic from VN2 that is destined to VN1 reaches the right interface of the service virtual machine.

Configuration interface for service instances with Interface 2 labeled Left, virtual network vn1, static route 11.1.1.0/24; Interface 3 labeled Right, virtual network vn2, static route 10.1.1.0/24; options to add or remove static routes and specify next hop; Cancel and Save buttons at bottom.

When the static routes are configured for both the left and the right interfaces, all inter-virtual network traffic is forwarded through the service instance.

Configuring Static Routes as Host Routes

You can also use static routes for host routes for a virtual machine, by using the classless static routes option in the DHCP server response that is sent to the virtual machine.

The routes to be sent in the DHCP response to the virtual machine can be configured for each virtual network as it is created.

To configure static routes as host routes:

  1. Go to Configure > Network > Networks and click Create.
  2. At Create Network, click the Host Routes option and add the host routes to be sent to the virtual machines.

    An example is shown in the following figure.

Create Network interface with IPAM ipam1, IP Block 1.2.3.0/24, Gateway 1.2.3.254, and Host Routes 1.1.1.0/24, 2.2.2.0/24. Save or Cancel options available.