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.

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.

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).
- Go to Networking > Forwarding > Service Function Chain.
- Click the "Add" button.
- Enter the Chain name.
- Select vWAN mode.
- Enter the vWAN IP address.
- Enter Gateway and Netmask.
- Click "Add VNF Node" to append containers to the service function chain.
- Click "Apply".

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
- Add the OpenVPN template and install the OpenVPN app via App Store.

- Go to Application > Information > Container.
- Click the Action icon for the OpenVPN App and select "Edit" to pop up the "Edit Container" dialog box.
- 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.
- Add Command to supply the OpenVPN username and password.
- Add Device
/dev/net/tun. Click "Apply".

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

Create and Start the OpenVPN Chain
- Go to Networking > Forwarding > Service Function Chain.
- Click "Add".
- Enter Chain name.
- Select vWAN mode.
- Enter IP.
- Enter Gateway and Netmask.
- Click "Add VNF Node" to add the OpenVPN container to the chain.
- Click "Apply".

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

Bind Traffic and Test the Connection
- Go to Networking > Forwarding > WAN Binding.
- Move
OpenVPN WANfrom Available WAN to In Use WAN. - Click "Apply".

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

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.

Steps to Deploy Alpine and AdGuard Containers:
- Go to Application > Template > Container > Add Template.
- Add an Alpine container template containing DNAT iptables rules. Fill in App Name, App Description, and upload an App Icon.

- 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(grantsNET_ADMINandNET_RAWcapabilities to execute iptables).
- Service Name:
- Click "Apply".

- Go to Application > Template > Container > Add Template.
- 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 Port3000, Private Port3000, HTTP(s) PortYes.
- App Name:
- 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: GrantsNET_ADMINandNET_RAWprivileges for iptables usage.

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

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.
- 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

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

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

Inspect Queries and Test Blocking
- 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.

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

- 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.


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.
- Go to Networking > Forwarding > Port Type, and move
eth1andeth2from WAN to LAN.

- Go to Networking > LAN > VLAN, and create VLAN 10 and VLAN 20.
- Edit
eth1to bind Access VLAN 10; editeth2to bind Access VLAN 20.

- Connect Laptop 1 to
eth1and assign IP192.168.10.10. - Connect Laptop 2 to
eth2and assign IP192.168.10.20. - Go to Application > App Store and install Nginx and Python applications.
- Go to Networking > Forwarding > Service Function Chain, click "Add".
- Set Mode to vBridge, enter Chain Name.
- Click "Add VNF Node" to select Nginx, followed by Python.
- Following the screenshot below, set Left VLAN to
10and Right VLAN to20, matching the two VLANs created earlier.

- Start the SFC via the Action icon.

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