Skip to content

Instantly share code, notes, and snippets.

@pertoft
Created January 11, 2019 13:37
Show Gist options
  • Save pertoft/2efac86c5a21b93e5d77ec4ee431acca to your computer and use it in GitHub Desktop.
Save pertoft/2efac86c5a21b93e5d77ec4ee431acca to your computer and use it in GitHub Desktop.
Openstack Ansible interfaces configuration example
#/etc/network/interfaces
auto lo
iface lo inet loopback
dns-nameservers 212.242.40.3
dns-search cloudlab.telenor.dk
### Physical interfaces
auto enp27s0f0
iface enp27s0f0 inet manual
bond-master bond0
auto enp27s0f1
iface enp27s0f1 inet manual
bond-master bond0
auto enp22s0f4
iface enp22s0f4 inet manual
bond-master bond1
auto enp22s0f5
iface enp22s0f5 inet manual
bond-master bond1
###Bonding configuration
auto bond0
iface bond0 inet manual
bond-slaves none
bond-miimon 100
bond-mode 802.3ad
bond-lacp-rate 1
xmit_hash_policy layer3+4
auto bond1
iface bond1 inet manual
bond-slaves none
bond-miimon 100
bond-mode 802.3ad
bond-lacp-rate 1
xmit_hash_policy layer3+4
###VLAN Definitions
#External Management
auto bond0.20
iface bond0.20 inet manual
vlan-raw-device bond0
#Internal Management
auto bond0.21
iface bond0.21 inet manual
vlan-raw-device bond0
#Storage
auto bond0.22
iface bond0.22 inet manual
vlan-raw-device bond0
#VXLAN
auto bond0.23
iface bond0.23 inet manual
vlan-raw-device bond0
#External Management
auto br-ext-mgmt
iface br-ext-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0.20
address 10.207.134.101/24
gateway 10.207.134.1
post-up route add -net 172.16.0.0 netmask 255.240.0.0 gw 10.207.134.1 metric 10 dev br-ext-mgmt || true
pre-down route del -net 172.16.0.0 netmask 255.240.0.0 gw 10.207.134.1 metric 10 dev br-ext-mgmt || true
# Container/Host management bridge
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0.21
# address 192.168.0.21/20
gateway 192.168.0.1
auto br-storage
iface br-storage inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0.22
address 192.168.16.21/20
# VXLAN (tunnel/overlay) bridge config
auto br-vxlan
iface br-vxlan inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0.23
address 192.168.32.21/20
# OpenStack Networking VLAN bridge
auto br-vlan
iface br-vlan inet manual
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0
source /etc/network/interfaces.d/*.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment