home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

Configuring service chaining by using PBR

Consider a scenario in which you have two guests VM1 and VM2, as illustrated in the following network diagram. These guests can be any services such as vNAT, vFW, vDPI, and so on.

The following list presents the components of the topology.
  • dp0p0s20f1 and dp0p0s20f0 are the ingress and egress interfaces, respectively, for vCPE or the vhost.
  • vhost0 and vhost1 are the virtual interfaces for VM1.
  • vhost2 and vhost3 are the virtual interfaces for VM2.
  • sc1-h1 and sc1-h2 are the PBR policies that are applied to dp0p0s20f1 and vhost1.
  • eth0 and eth1 are the interfaces of VM1 and VM2.
Figure 1. Service chaining by using PBR

In the topology, to perform service chaining between VM1 and VM2, the PBR policy is applied on dp0p0s20f1 and vhost1, and the route policy lookup is performed on all packets that are received on the dp0p0s20f1 and vhost1 interfaces. If there is a match, the route lookup is performed on the corresponding PBR tables 1 and 2.

In each service route table, static routes are added with the next hop interface pointing to a service guest.

Table 1. Configuring service chaining
Step Commands

Configure the PBR policy.

vyatta@vyatta# set policy route pbr sc1-h1 rule 1 action 'accept'
vyatta@vyatta# set policy route pbr sc1-h1 rule 1 address-family 'ipv4'
vyatta@vyatta# set policy route pbr sc1-h1 rule 1 table '1'
vyatta@vyatta# set policy route pbr sc1-h2 rule 1 action 'accept'
vyatta@vyatta# set policy route pbr sc1-h2 rule 1 address-family 'ipv4'
vyatta@vyatta# set policy route pbr sc1-h2 rule 1 table '2'

Configure the static route.

vyatta@vyatta# set protocols static table 1 route 0.0.0.0/0 next-hop '11.11.11.2'
vyatta@vyatta# set protocols static table 2 route 0.0.0.0/0 next-hop '33.33.33.2'

Attach the PBR policy to the corresponding interface.

vyatta@vyatta# set interfaces dataplane dp0p0s20f1 policy route pbr 'sc1-h1'
vyatta@vyatta# set interfaces vhost dp0vhost1 policy route pbr 'sc1-h2'

Configure the IP addresses on the interfaces.

vyatta@vyatta# set interfaces dataplane dp0p0s20f1 address '192.0.2.1/24'
vyatta@vyatta# set interfaces dataplane dp0p0s20f0 address '198.51.100.1/24'
vyatta@vyatta# set interfaces vhost dp0vhost0 address '11.11.11.1/24'
vyatta@vyatta# set interfaces vhost dp0vhost1 address '22.22.22.1/24'
vyatta@vyatta# set interfaces vhost dp0vhost2 address '33.33.33.1/24'
vyatta@vyatta# set interfaces vhost dp0vhost3 address '44.44.44.1/24'
Note: The dp0vhost0 interface corresponds to eth0 of the VM1 interface and both the VMs should be on the same subnet.

Commit the configuration.

vyatta@vyatta# commit

Save the configuration.

vyatta@vyatta# save