How to Run a bridge as a service on Ubuntu 20.04 LTS¶
This Document shows how to set up the swXtch-bridge application running as a service on Ubuntu 20.04.¶
To Run a Bridge as a Service, you will first need to provision a VM/Agent and install the swXtch-bridge application. These steps can be found in the User Manual.
After installing the swXtch-bridge application, you will need to follow the below steps to configure your bridge service.
Create the service and change its permission to become an executable file:¶
Edit the service file:¶
[Unit] Description=swXtch.io bridge service After=syslog.target After=network.target[Service] Type=simple ExecStart=/usr/local/bin/bridge2.sh
[Install] WantedBy=default.target
Note: on the ExecStart line you must put the full path of the script or command to run.
Enable the Service:¶
Before enabling the service, you can check the current status of it by running this command:
The below screenshot shows that the service is currently “disabled”
Now run the below commands:
Confirm Bridge Service is active:
Create the shell script and assign the necessary permissions:¶
Next, edit it with the command below:#!/bin/bash
#Sleep startup to allow xnic program to boot so you can utilize swxtch-tun0 ip
sleep 10s
swxtch-bridge --input multicast://239.5.69.2:172.30.0.42:10000,multicast://239.5.69.3:172.30.0.42:10000 --output udp://10.2.153.4:9999 --override-multicast-sender-ip 172.30.1.1 --last-leg &
swxtch-perf producer --pps 1000
Reboot VM and Confirm Service booted at Startup as Expected¶
The above screenshot shows the bridge status is “enabled” and that upon boot the system ran the executable command given in the service file to succession. The Bridge upon boot is performing the following actions:
-
Receiving traffic from a swXtch in the same upstream subnet via 2 multicast groups - 239.5.69.2 & 239.5.69.3
-
Pushing that traffic at 1k pps to the downstream swXtch that resides on a different subnet.
Next, Set an Agent on a downstream subnet to listen to the downstream swXtch for the traffic being pushed from that upstream bridge as seen above¶
To do this, you can run the below command on any agent in your downstream swXtch subnet to consume the traffic being sent:
You can now monitor the flow of this traffic by running the “swxtch-top” command on any of your downstream or upstream agents that have the xNIC program installed to be able to see the flow of traffic. The screenshot below shows that your upstream bridge is now transmitting traffic to your downstream swXtch and the packets are being consumed by a downstream agent.

This document shows how you can achieve the flow of multicast traffic from one upstream bridge to a downstream swXtch using an Ubuntu Agent running v. 20.04 LTS