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

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

No Scrubs: The Architecture That Made Unmetered Mitigation Possible

When building a DDoS mitigation service it’s incredibly tempting to think that the solution is scrubbing centers or scrubbing servers. I, too, thought that was a good idea in the beginning, but experience has shown that there are serious pitfalls to this approach. Read the post of at Cloudflare's blog: N o Scrubs: The Architecture That Made Unmetered Mitigation Possible

Should You Buy A UniFi Dream Machine, USG, USG Pro, or Dream Machine Pro?