From 358be0158e8b10dd3694a4d8de43b096ac9fe6cf Mon Sep 17 00:00:00 2001 From: d34dh0r53 Date: Fri, 1 Jun 2018 15:40:44 -0500 Subject: [PATCH] Adjust flat networking This adjusts the VM networking to only create the additional veth pair for the flat bridge. Without this the other bridges can get IPs other than those statically assigned by the DHCP server. This also adjusts the range to exclude the statically assigned ranges. Change-Id: I289e808b5acb68b1c51e05cbe7d914077c20ba1a --- multi-node-aio/playbooks/group_vars/dhcp_hosts.yml | 2 +- multi-node-aio/playbooks/pxe/configs/debian/vm-bridges.cfg.j2 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml b/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml index 19419853..79e3ca19 100644 --- a/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml +++ b/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml @@ -20,7 +20,7 @@ dhcp_list: gateway: 10.0.2.1 # Gateway dns: 8.8.8.8 # DNS subnet: 10.0.0.0 # Subnet mask - range_start: 10.0.2.3 # Start of DHCP range + range_start: 10.0.2.160 # Start of DHCP range range_end: 10.0.3.254 # End of DHCP range broadcast: 10.0.3.255 # Network Broadcast address default_lease_time: 21600 # Subnet Default lease time - The default is used if this is not defined diff --git a/multi-node-aio/playbooks/pxe/configs/debian/vm-bridges.cfg.j2 b/multi-node-aio/playbooks/pxe/configs/debian/vm-bridges.cfg.j2 index 3505172a..2a622bed 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/vm-bridges.cfg.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/vm-bridges.cfg.j2 @@ -16,7 +16,7 @@ iface br-{{ key }} inet {{ value.inet_type }} bridge_waitport 10 bridge_fd 0 offload-sg off -{% if value.iface is defined %} +{% if value.iface is defined and key == "flat" %} pre-up ip link add br-veth-{{ key }} type veth peer name v{{ value.iface }} || true # Set both ends UP pre-up ip link set br-veth-{{ key }} up @@ -24,6 +24,8 @@ iface br-{{ key }} inet {{ value.inet_type }} # Delete veth pair on DOWN post-down ip link del br-vlan-veth || true bridge_ports {{ value.iface }} br-veth-{{ key }} +{% elif value.iface is defined %} + bridge_ports {{ value.iface | default('none') }} {% else %} bridge_ports none {% endif %}