Skip to content

Instantly share code, notes, and snippets.

@mdbraber
Last active December 20, 2022 17:38
Show Gist options
  • Save mdbraber/cf438a97e32a8711185f591814415cbb to your computer and use it in GitHub Desktop.
Save mdbraber/cf438a97e32a8711185f591814415cbb to your computer and use it in GitHub Desktop.
Network interfaces setup (/etc/network/interfaces)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto ens18
iface ens18 inet static
address 172.16.0.3/20
gateway 172.16.0.1
up ifconfig ens18 promisc up
down ifconfig ens18 promisc down
up ip link add mgmtshim link ens18 type macvlan mode bridge
up ip addr add 172.16.1.254/24 dev mgmtshim
up ifconfig mgmtshim up
auto ens18.16
iface ens18.16 inet static
address 172.16.16.3/20
gateway 172.16.16.1
up ifconfig ens18.16 promisc up
down ifconfig ens18.16 promisc down
up route add -net 172.16.16.0 netmask 255.255.240.0 gw 172.16.16.1
down route del -net 172.16.16.0 netmask 255.255.240.0 gw 172.16.16.1
up ip link add trustedshim link ens18.16 type macvlan mode bridge
up ip addr add 172.16.17.254/24 dev trustedshim
up ifconfig trustedshim up
auto ens18.32
iface ens18.32 inet static
address 172.16.32.3/20
gateway 172.16.32.1
up ifconfig ens18.32 promisc up
down ifconfig ens18.32 promisc down
up route add -net 172.16.32.0 netmask 255.255.240.0 gw 172.16.32.1
down route del -net 172.16.32.0 netmask 255.255.240.0 gw 172.16.32.1
up ip link add vpnoutshim link ens18.32 type macvlan mode bridge
up ip addr add 172.16.33.254/24 dev vpnoutshim
up ifconfig vpnoutshim up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment