Skip to content

Instantly share code, notes, and snippets.

@tonyklawrence
Last active April 12, 2023 17:10
Show Gist options
  • Save tonyklawrence/b477dcf624577ab154ed3b51cea60e27 to your computer and use it in GitHub Desktop.
Save tonyklawrence/b477dcf624577ab154ed3b51cea60e27 to your computer and use it in GitHub Desktop.
Docker containers using VLAN network on Synology DSM 6.X
First we need to create the VLAN on the Synology from the command line:
See: https://nielshagoort.com/2016/03/30/synology-vlan-tagging/
Then add Network to Docker using maclvan driver
See: https://docs.docker.com/engine/userguide/networking/get-started-macvlan/#macvlan-8021q-trunk-bridge-mode-example-usage
Details...
/etc/sysconfig/network-scripts
DEVICE=bond0.99
VLAN_ROW_DEVICE=bond0
VLAN_ID=99
BOOTPROTO=dhcp
ONBOOT=yes
BONDING_OPTS="mode=2 use_carrier=1 miimon=100 updelay=100"
USERCTL=no
docker network create -d macvlan \
--subnet=192.168.50.0/24 \
--gateway=192.168.50.1 \
-o parent=eth0.50 macvlan50
docker network create -d macvlan \
--subnet=172.7.0.0/24 \
--gateway=172.7.0.1 \
-o parent=bond.99 secure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment