Skip to content

Instantly share code, notes, and snippets.

@v1k0d3n
Created July 25, 2016 15:05
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 v1k0d3n/e5567a11dd680248ce58b29fefe6a7c8 to your computer and use it in GitHub Desktop.
Save v1k0d3n/e5567a11dd680248ce58b29fefe6a7c8 to your computer and use it in GitHub Desktop.
# Copyright 2016, JinkIT, and it's Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# 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
# 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 192.168.3.22
netmask 255.255.255.0
gateway 192.168.3.1
dns-search kubelab.com
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.22
netmask 255.255.252.0
gateway 172.29.240.1
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.22
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.22
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