oosVersion 2.1

Service Function Chain

Guide to configuring and managing Service Function Chains (SFC) in OOS using VNF containers in vWAN and vBridge modes, featuring OpenVPN and AdGuard setup examples.

Service Function Chain (SFC)

A Service Function Chain (SFC) sends network data through containers in a chosen order, such as redirecting DNS queries before filtering them. A container is an isolated environment running an application. A container that processes network traffic on the chain is called a Virtual Network Function (VNF). Use this page when adding VPN, DNS filtering, or VLAN bridging to a traffic path.

Prepare the containers, VLANs, and WAN details first. The application versions, IP addresses, interfaces, and resource values below are examples for this guide. Use your planned settings when deploying.

!WARNING Starting a chain and changing VLANs or WAN bindings alters the traffic path. The AdGuard example also changes forwarding rules inside a container. Before making changes, record the original settings, check the target VLAN, its ports, and the management connection, and agree with your administrator how to restore the settings and regain management access if disconnected. Work at a time when connection interruptions are acceptable.

Service Function Chain concept and VNF architecture diagram

The Service Function Chain page supports two operation modes:

  • Virtual WAN (vWAN) Mode: Connects one or more containers in series, passing network traffic from Container 1 to Container 2 through Container N.
  • Virtual Bridge (vBridge) Mode: Establishes container-based bridging between different VLANs.

Overview of vWAN and vBridge modes in SFC


Creating a vWAN Service Function Chain

vWAN uses a container chain as an external connection. Install the containers first and obtain the chain's IP address, Gateway (exit to other networks), and Netmask (subnet boundary).

  1. Go to Networking > Forwarding > Service Function Chain.
  2. Click the "Add" button.
  3. Enter the Chain name.
  4. Select vWAN mode.
  5. Enter the vWAN IP address.
  6. Enter Gateway and Netmask.
  7. Click "Add VNF Node" to append containers to the service function chain.
  8. Click "Apply".

Create vWAN Service Function Chain interface


Configuration Example 1: OpenVPN Service Function Chain

With an OpenVPN container deployed on the device, client devices connected to the CPE can establish VPN connectivity to a corporate OpenVPN server without local client configuration.

Obtain the OpenVPN username, password, and .ovpn connection file from the VPN administrator first. In this example, CPE means the OOS device serving the LAN clients.

Install the Container and Prepare Its Connection File

  1. Add the OpenVPN template and install the OpenVPN app via App Store.

OpenVPN app in App Store

  1. Go to Application > Information > Container.
  2. Click the Action icon for the OpenVPN App and select "Edit" to pop up the "Edit Container" dialog box.
  3. Configure the Egress WAN Interface.

    !NOTENote: If the OpenVPN server resides on the corporate internal network, the Egress WAN Interface must not be assigned to the internal corporate interface.

  4. Add Command to supply the OpenVPN username and password.
  5. Add Device /dev/net/tun. Click "Apply".

Edit OpenVPN container configuration

  1. Go to Application > Volume.
  2. Select the target volume (e.g., OpenVPN-0318_OpenVPN_vpn).
  3. Click the upload icon to upload the .ovpn configuration file required for the VPN tunnel.

Upload OpenVPN config file to Volume

Create and Start the OpenVPN Chain

  1. Go to Networking > Forwarding > Service Function Chain.
  2. Click "Add".
  3. Enter Chain name.
  4. Select vWAN mode.
  5. Enter IP.
  6. Enter Gateway and Netmask.
  7. Click "Add VNF Node" to add the OpenVPN container to the chain.
  8. Click "Apply".

Add OpenVPN vWAN service function chain

  1. Go to Networking > Forwarding > Service Function Chain.
  2. Click the OpenVPN App Action icon and select "Start" to launch the chain.

Start OpenVPN service function chain

Bind Traffic and Test the Connection

  1. Go to Networking > Forwarding > WAN Binding.
  2. Move OpenVPN WAN from Available WAN to In Use WAN.
  3. Click "Apply".

Bind OpenVPN WAN to active WAN list

  1. Connect a laptop to the LAN SSID and ping the gateway at the OpenVPN server site to verify VPN connectivity.

Ping test verifying OpenVPN server site gateway connection


Configuration Example 2: AdGuard Ad-Blocking Service Function Chain

This example uses AdGuard for DNS filtering. DNS converts website names to IP addresses. An Alpine container placed before AdGuard uses DNAT (Destination Network Address Translation, which redirects traffic to a specified destination) to send DNS queries to AdGuard. The two containers then form a service function chain.

AdGuard SFC topology diagram

Steps to Deploy Alpine and AdGuard Containers:

  1. Go to Application > Template > Container > Add Template.
  2. Add an Alpine container template containing DNAT iptables rules. Fill in App Name, App Description, and upload an App Icon.

Add Alpine container template

  1. Configure Service settings:
    • Service Name: Alpine
    • Registry: hub.docker.com
    • Image Name: alpine
    • Image Tag: 3.13
    • Resource Limitation: Low: 0.2 Cores CPU + 128 MB Memory
    • Network Endpoint: bridge
    • Egress WAN Interface: Default (Highest Priority WAN)
    • Add Device: /dev/net/tun (grants NET_ADMIN and NET_RAW capabilities to execute iptables).
  2. Click "Apply".

Configure Alpine service parameters

  1. Go to Application > Template > Container > Add Template.
  2. Add the AdGuard container template:
    • App Name: Adguard
    • App Description: Network-wide ads & trackers blocking DNS server
    • Service Name: Adguard
    • Registry: hub.docker.com
    • Image Name: adguard/adguardhome
    • Image Tag: latest
    • Resource Limitation: Medium: 0.5 Cores CPU + 512 MB Memory
    • Network Endpoint: bridge
    • Egress WAN Interface: Mobile Network (internet)
    • Environment Variable: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    • Port Binding: Protocol TCP, Public Port 3000, Private Port 3000, HTTP(s) Port Yes.
  3. Click "Apply".

!NOTE

  • Egress WAN Interface: AdGuard is the egress VNF container on the chain; therefore, a specific WAN interface must be selected (cannot use Default).
  • Device /dev/net/tun: Grants NET_ADMIN and NET_RAW privileges for iptables usage.

Configure AdGuard service parameters

  1. Go to Application > App Store > Application > Container and install Alpine and AdGuard.
  2. Go to Application > Information > Container.
  3. Click the AdGuard port mapping link (http://CPE_IP:3000) to access the AdGuard interface.

Container information and AdGuard port mapping link

Configure DNS Forwarding Inside Alpine

Administrators only: The commands below use iptables, a tool for managing network packet rules. If you are unfamiliar with containers and packet rules, do not copy and run them; have the deployment administrator handle this step.

Adguard_IP is a placeholder. Before execution, obtain the actual AdGuard container IP reachable from Alpine from the deployment administrator and substitute it. Use http://CPE_IP:3000 to open the AdGuard console.

Confirm that the Console belongs to the Alpine container before execution. The rule below forwards UDP 53 DNS queries to the specified AdGuard IP.

  1. Click the Console icon under Alpine Action, and execute iptables commands to redirect Port 53 DNS traffic to the AdGuard container IP:
bash
apk update
apk add iptables
iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to-destination Adguard_IP:53

Execute iptables command in Alpine container console

Chain Alpine Before AdGuard

  1. Go to Networking > Forwarding > Service Function Chain, click "Add".
  2. Enter Chain Name, select vWAN mode, and specify IP, Gateway, and Netmask.
  3. Click "Add VNF Node" to add Alpine as Container 1.
  4. Click "Add VNF Node" to add AdGuard as Container 2.
  5. Click "Apply".

Create SFC chaining Alpine and AdGuard

  1. Click Action icon to start the AdGuard service function chain.
  2. Go to Networking > Forwarding > WAN Binding and bind the AdGuard interface to active WAN to route LAN device traffic through AdGuard.

Bind AdGuard interface to active WAN

Inspect Queries and Test Blocking

  1. Open YouTube on a LAN device and inspect the traffic and query records in AdGuard to check that queries from the test device are arriving.

AdGuard dashboard showing network traffic

  1. Go to the Filter page in AdGuard and enable the YouTube blocking rule.

Enable YouTube blocking rule in AdGuard

  1. Ping YouTube from a LAN device and try opening its website. The test results below show no Ping response and a blocked YouTube page that cannot load.

Ping YouTube failure console screen

YouTube blocked screen


Configuration Example 3: vBridge Mode Connection

vBridge mode establishes container-mediated bridging between two separate VLANs.

This example uses VLAN 10, VLAN 20, two laptops, and Nginx and Python containers. The IP addresses and interface names are for reference; confirm they fit your environment before using them.

  1. Go to Networking > Forwarding > Port Type, and move eth1 and eth2 from WAN to LAN.

Move eth1 and eth2 from WAN to LAN

  1. Go to Networking > LAN > VLAN, and create VLAN 10 and VLAN 20.
  2. Edit eth1 to bind Access VLAN 10; edit eth2 to bind Access VLAN 20.

VLAN configuration and port binding

  1. Connect Laptop 1 to eth1 and assign IP 192.168.10.10.
  2. Connect Laptop 2 to eth2 and assign IP 192.168.10.20.
  3. Go to Application > App Store and install Nginx and Python applications.
  4. Go to Networking > Forwarding > Service Function Chain, click "Add".
  5. Set Mode to vBridge, enter Chain Name.
  6. Click "Add VNF Node" to select Nginx, followed by Python.
  7. Following the screenshot below, set Left VLAN to 10 and Right VLAN to 20, matching the two VLANs created earlier.

Create vBridge mode service function chain

  1. Start the SFC via the Action icon.

Start vBridge service function chain

  1. Ping Laptop 2 IP (192.168.10.20) from Laptop 1 to receive responses.
  2. Ping Laptop 1 IP (192.168.10.10) from Laptop 2 to verify cross-VLAN bridging functionality.