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.
- 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.
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.
Step | Commands |
---|---|
Configure the PBR policy. |
|
Configure the static route. |
|
Attach the PBR policy to the corresponding interface. |
|
Configure the IP addresses on the interfaces. |
Note: The dp0vhost0 interface corresponds to eth0 of the VM1 interface and both the VMs should be on the same subnet.
|
Commit the configuration. |
|
Save the configuration. |
|