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)

Virtual Network Functions (VNFs) are used to construct Service Function Chains (SFC), enabling network packets to sequentially traverse VNF instances on the chain. VNF chains improve deployment efficiency while minimizing system resource consumption, allowing service providers to introduce VNF features rapidly without altering source code.

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

  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.

  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

  1. Go to Networking > Forwarding > Service Function Chain.
  2. Click "Add".
  3. Enter Chain name, select vWAN mode.
  4. Enter IP, Gateway, and Netmask.
  5. Click "Add VNF Node" to add the OpenVPN container to the chain.
  6. 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

  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

AdGuard is an ad-blocking application that suppresses pop-ups, banners, and video ads. To deploy AdGuard as a VNF node on an SFC, an Alpine container running DNAT rules is positioned ahead of AdGuard to redirect incoming DNS query traffic to AdGuard.

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

  1. Click the Console icon under Alpine Action, and execute iptables commands to redirect Port 53 DNS traffic to the AdGuard container IP:
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

  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

  1. Open YouTube on a LAN device to verify traffic passing through AdGuard.

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. Test pinging YouTube from a LAN device; no response is received, confirming YouTube access is blocked.

Ping YouTube failure console screen

YouTube blocked screen


Configuration Example 3: vBridge Mode Connection

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

  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. Set Left VLAN to 10 and Right VLAN to 10.

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.

We use necessary cookies to keep the website working. With your permission, we also use analytics cookies to understand how the site is used. Read our Cookie Policy