Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save evrardjp/f970315fb9094acb65c9e424f54273b0 to your computer and use it in GitHub Desktop.
Save evrardjp/f970315fb9094acb65c9e424f54273b0 to your computer and use it in GitHub Desktop.
Example network interface file using a single bonded interface
## The default networking requires several bridges. These bridges were named to be informative
## however they can be named what ever you like and is adaptable to any network infrastructure
## environment. This file serves as an example of how to setup basic networking and was ONLY
## built for the purpose of being an example of an environment with a single bonded interface.
# Physical interface
# ------------------
# All nodes will have some physical interface
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
# Physical interface
# ------------------
# All nodes will have some physical interface
auto eth1
iface eth1 inet manual
bond-master bond1
bond-primary eth1
# Bonded device
# -------------
# The bond is not required but it can provide better throughput and redundancy.
auto bond0
iface bond0 inet manual
bond-slaves none
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
address 10.240.0.100
netmask 255.255.252.0
gateway 10.240.0.1
dns-nameservers 8.8.8.8 8.8.4.4
# Bridge for vlan network
# -----------------------
# Used by all compute and network nodes
# The IP address on this device is optional
auto br-vlan
iface br-vlan inet static
pre-up ip link add br-vlan-veth type veth peer name eth12 || true # Create veth pair
pre-up ip link set br-vlan-veth up # Set the veth UP
pre-up ip link set eth12 up # Set the veth UP
post-down ip link del br-vlan-veth || true # Delete veth pair on DOWN
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports bond0 br-vlan-veth # Notice this bridge port is an Untagged host interface
offload-sg off
address 172.29.236.100
netmask 255.255.252.0
gateway 172.29.236.1
dns-nameservers 8.8.8.8 8.8.4.4
# Tagged vlan network interfaces
# ------------------------------
# Used in various bridges
auto br-vlan.101
iface br-vlan.101 inet manual
vlan-raw-device br-vlan
vlan_id 101
auto br-vlan.102
iface br-vlan.102 inet manual
vlan-raw-device br-vlan
vlan_id 102
auto br-vlan.103
iface br-vlan.103 inet manual
vlan-raw-device br-vlan
vlan_id 103
# Bridge for vxlan network
# ------------------------
# Used by all compute and network nodes
auto br-vxlan
iface br-vxlan inet manual
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports br-vlan.101 # Notice the bridge port is the vlan tagged interface
offload-sg off
address 172.29.240.100
netmask 255.255.252.0
dns-nameservers 8.8.8.8 8.8.4.4
# Bridge for management network
# -----------------------------
# Used by all nodes
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports br-vlan.102 # Notice the bridge port is the vlan tagged interface
offload-sg off
address 172.29.236.100
netmask 255.255.252.0
gateway 172.29.236.1
dns-nameservers 8.8.8.8 8.8.4.4
# Bridge for storage network
# --------------------------
# Used by all compute and storage nodes
auto br-storage
iface br-storage inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports br-vlan.103 # Notice the bridge port is the vlan tagged interface
offload-sg off
address 172.29.244.100
netmask 255.255.252.0
gateway 172.29.244.1
dns-nameservers 8.8.8.8 8.8.4.4
# Source other interface files that may be found
# ----------------------------------------------
source /etc/network/interfaces.d/*.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment