Skip to main content

Configuring containers on a SD-WAN edge

 


Fusion Broadband has the ability to host containers and docker on the edge node. The configuration relies on creating a separate instance of debian using systemd's nspawn. That can be used for a number of different applications including docker. You can also install a VPN concentrator such as softether. This is how to configure it:

# On the SD-WAN edge

sudo nano /etc/network/interfaces

auto lo
iface lo inet loopback

iface eth0 inet manual

auto br0
iface br0 inet static
    bridge_ports eth0
    address 10.207.35.254
    netmask 255.255.255.248
    scope link
    pre-up sysctl -w net.ipv6.conf.eth0.accept_ra=0


# On the SD-WAN edge
sudo apt-get update --allow-releaseinfo-change
sudo apt-get upgrade
sudo apt-get install systemd-container debootstrap
sudo mkdir /var/lib/machines/container
sudo debootstrap \
--include curl,bridge-utils,dbus,iptables,openssh-server,vim \
bullseye /var/lib/machines/container \
http://http.debian.net/debian

If you have debootstrap key errors, do this.

# On the SD-WAN edge
sudo systemd-nspawn --directory /var/lib/machines/container passwd
sudo systemd-nspawn --boot --directory /var/lib/machines/container/
* Log in using root password that was created in above step

hostnamectl set-hostname container
apt-get install sudo ca-certificates mtr wget
adduser admin (or suitable alternative)
usermod -aG sudo admin

sudo nano /etc/network/interfaces

auto host0
iface host0 inet dhcp

sudo chmod 4711 /usr/bin/ping

# To exit the container press Ctl [ 3 times


# On the SD-WAN edge
sudo mkdir /etc/systemd/nspawn
sudo nano /etc/systemd/nspawn/container.nspawn

[Exec]
Boot=yes
[Network]
VirtualEthernet=yes
Bridge=br0

sudo systemctl enable systemd-nspawn@container
sudo systemctl enable machines.target
sudo systemctl start machines.target


# On the SD-WAN edge
# To access the container
sudo machinectl login container

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update
sudo apt install docker-ce

It is now possible to install various docker applications such as:

The mac address of the nspawn instance can be configured with a static IP using the custom DNSMASQ configuration ability of the Fusion SD-WAN.

dhcp-host=08:55:31:D4:B5:AD,192.168.254.253
This article was originally published over on LinkedIn: Configuring containers on a SD-WAN edge

Comments

Popular posts from this blog

LDWin: Link Discovery for Windows

LDWin supports the following methods of link discovery: CDP - Cisco Discovery Protocol LLDP - Link Layer Discovery Protocol Download LDWin from here.

easywall - Web interface for easy use of the IPTables firewall on Linux systems written in Python3.

Firewalls are becoming increasingly important in today’s world. Hackers and automated scripts are constantly trying to invade your system and use it for Bitcoin mining, botnets or other things. To prevent these attacks, you can use a firewall on your system. IPTables is the strongest firewall in Linux because it can filter packets in the kernel before they reach the application. Using IPTables is not very easy for Linux beginners. We have created easywall - the simple IPTables web interface . The focus of the software is on easy installation and use. Access this neat software over on github: easywall

Latest: updatethreatblock.sh

#!/bin/bash # # usage updatethreatblock.sh <configuration file> # eg: updatethreatblock.sh /etc/ipset-threatblock/ipset-threatblock.conf # function exists() { command -v "$1" >/dev/null 2>&1 ; } if [[ -z "$1" ]]; then   echo "Error: please specify a configuration file, e.g. $0 /etc/ipset-threatblock/ipset-threatblock.conf"   exit 1 fi # shellcheck source=ipset-threatblock.conf if ! source "$1"; then   echo "Error: can't load configuration file $1"   exit 1 fi if ! exists curl && exists egrep && exists grep && exists ipset && exists iptables && exists sed && exists sort && exists wc ; then   echo >&2 "Error: searching PATH fails to find executables among: curl egrep grep ipset iptables sed sort wc"   exit 1 fi DO_OPTIMIZE_CIDR=no if exists iprange && [[ ${OPTIMIZE_CIDR:-yes} != no ]]; then   DO_OPTIMIZE_CIDR=yes fi if [[ ! -d $(dirname &q