Add documentation for routed interfaces
Using the container_(extra)_networks hash a user can define a routed interface for a network without an address. This change documents that capability. Change-Id: I93bdfde1aa5a9820d1853a779caf6670ee58d335 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
ca6fe7df8d
commit
7ba42bc3d7
|
@ -33,6 +33,8 @@ nspawn_networks:
|
||||||
netmask: 255.255.255.0
|
netmask: 255.255.255.0
|
||||||
# Optional | Set the macvlan mode
|
# Optional | Set the macvlan mode
|
||||||
macvlan_mode: bridge
|
macvlan_mode: bridge
|
||||||
|
# Optional | set the routed interface
|
||||||
|
routed_interface: mv-nspawn0
|
||||||
|
|
||||||
# Primary interface used for host to container communications. In the event that
|
# Primary interface used for host to container communications. In the event that
|
||||||
# the underlying system is running a condensed network stack a route will be
|
# the underlying system is running a condensed network stack a route will be
|
||||||
|
@ -57,6 +59,7 @@ nspawn_networks:
|
||||||
# + simple example:
|
# + simple example:
|
||||||
# management_cidr: "172.29.236.0/24"
|
# management_cidr: "172.29.236.0/24"
|
||||||
# storage_cidr: "10.0.0.0/24"
|
# storage_cidr: "10.0.0.0/24"
|
||||||
|
# flat_cidr: "172.29.239.0/24"
|
||||||
# container_networks:
|
# container_networks:
|
||||||
# management_address:
|
# management_address:
|
||||||
# bridge: eth0
|
# bridge: eth0
|
||||||
|
@ -66,6 +69,10 @@ nspawn_networks:
|
||||||
# netmask: 255.255.255.0
|
# netmask: 255.255.255.0
|
||||||
# tunnel_address:
|
# tunnel_address:
|
||||||
# bridge: eth0.10
|
# bridge: eth0.10
|
||||||
|
# flat_address:
|
||||||
|
# bridge: eth0
|
||||||
|
# interface: mv-flat
|
||||||
|
# routed_interface: mv-flat
|
||||||
#
|
#
|
||||||
# Extra interfaces that are wholly configured by the user can be set using the
|
# Extra interfaces that are wholly configured by the user can be set using the
|
||||||
# container extra networks option. This option follows all of the parameters of
|
# container extra networks option. This option follows all of the parameters of
|
||||||
|
@ -80,6 +87,8 @@ container_extra_networks: {}
|
||||||
# assigned to the underlying interface, "eth0".
|
# assigned to the underlying interface, "eth0".
|
||||||
# + The tunnel network will be attached to the container and isolated from the
|
# + The tunnel network will be attached to the container and isolated from the
|
||||||
# host with no access to without first attaching to the container.
|
# host with no access to without first attaching to the container.
|
||||||
|
# + The flat network will be created and attached to the container with a host
|
||||||
|
# route on the defined `routed_interface`.
|
||||||
#
|
#
|
||||||
nspawn_primary_interface: "{{ nspawn_networks['nspawn_address']['bridge'] }}"
|
nspawn_primary_interface: "{{ nspawn_networks['nspawn_address']['bridge'] }}"
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
{%- set _ = start_commands.append('-/sbin/ip link set dev ' + mv_interface + ' up') %}
|
{%- set _ = start_commands.append('-/sbin/ip link set dev ' + mv_interface + ' up') %}
|
||||||
{% if hostvars[inventory_hostname][key.split('_')[0] + '_cidr'] is defined and (value.address is undefined) %}
|
{% if hostvars[inventory_hostname][key.split('_')[0] + '_cidr'] is defined and (value.address is undefined) %}
|
||||||
{% set net_cidr = hostvars[inventory_hostname][key.split('_')[0] + '_cidr'] %}
|
{% set net_cidr = hostvars[inventory_hostname][key.split('_')[0] + '_cidr'] %}
|
||||||
{% set _ = start_commands.append('-/sbin/ip route add ' + net_cidr + ' dev ' + nspawn_primary_interface + ' metric 100 proto kernel scope link table local') %}
|
{% set _ = start_commands.append('-/sbin/ip route add ' + net_cidr + ' dev ' + (value.routed_interface | default(nspawn_primary_interface)) + ' metric 100 proto kernel scope link table local') %}
|
||||||
{% elif (value.address is defined) and ((interface_data['ipv4'] | default({'address': none}))['address'] != value.address) %}
|
{% elif (value.address is defined) and ((interface_data['ipv4'] | default({'address': none}))['address'] != value.address) %}
|
||||||
{% set _ = start_commands.append('-/sbin/ip address add ' + value.address + '/' + (value.netmask | default('32')) + ' dev ' + mv_interface + ' scope host') %}
|
{% set _ = start_commands.append('-/sbin/ip address add ' + value.address + '/' + (value.netmask | default('32')) + ' dev ' + mv_interface + ' scope host') %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue