Skip to content

Instantly share code, notes, and snippets.

@cloudnull
Created March 6, 2017 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudnull/67a66141d2da6e1908514ba3cae74393 to your computer and use it in GitHub Desktop.
Save cloudnull/67a66141d2da6e1908514ba3cae74393 to your computer and use it in GitHub Desktop.
Example OSA interface used with a single nic and a desire to create a production like setup.
## 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 interface interface
## with the desire to create a bridge configuration that resembles production.
# Physical interface
# ------------------
# All nodes will have some physical interface
auto eth0
iface eth0 inet manual
# Bridge for integration network
# ------------------------------
# Used by all other bridges
# The IP address on this device is Required
auto br-int
iface br-int inet static
### vxlan veth
pre-up ip link add vlan-veth1 type veth peer name vlan-veth2 || true # Create veth pair
pre-up ip link set vlan-veth1 up # Set the veth UP
pre-up ip link set vlan-veth2 up # Set the veth UP
post-down ip link del vlan-veth1 || true # Delete veth pair on DOWN
### vxlan veth
### vxlan veth
pre-up ip link add vxlan-veth1 type veth peer name vxlan-veth2 || true # Create veth pair
pre-up ip link set vxlan-veth1 up # Set the veth UP
pre-up ip link set vxlan-veth2 up # Set the veth UP
post-down ip link del vxlan-veth1 || true # Delete veth pair on DOWN
### vxlan veth
### Management veth
pre-up ip link add mgmt-veth1 type veth peer name mgmt-veth2 || true # Create veth pair
pre-up ip link set mgmt-veth1 up # Set the veth UP
pre-up ip link set mgmt-veth2 up # Set the veth UP
post-down ip link del mgmt-veth1 || true # Delete veth pair on DOWN
### Management veth
### storage veth
pre-up ip link add storage-veth1 type veth peer name storage-veth2 || true # Create veth pair
pre-up ip link set storage-veth1 up # Set the veth UP
pre-up ip link set storage-veth2 up # Set the veth UP
post-down ip link del storage-veth1 || true # Delete veth pair on DOWN
### storage veth
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports eth0 vlan-veth1 vxlan-veth1 mgmt-veth1 storage-veth1
offload-sg off
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.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
# If no IP address is set change "static" to "manual"
auto br-vlan
iface br-vlan inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports vlan-veth2
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 vxlan network
# ------------------------
# Used by all compute and network nodes
# The IP address on this device is Required
auto br-vxlan
iface br-vxlan inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports vxlan-veth2 # Notice the bridge port is the veth 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
# The IP address on this device is Required
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports mgmt-veth2 # Notice the bridge port is the veth 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
# The IP address on this device is Optional.
# If no IP address is set change "static" to "manual"
auto br-storage
iface br-storage inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports storage-veth2 # Notice the bridge port is the veth 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