Skip to content

Commit 66ac726

Browse files
committed
Add public_default_route to allow applying default route
Sometimes, the default route can't be applied on br-ex via DHCP for some reasons, and it can be useful to add this route manually before os-net-config is creating the br-ex bridge. It'll avoid networking issues. This feature is disabled by default for backward compability.
1 parent b8c6431 commit 66ac726

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

playbooks/templates/dev-install_net_config.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ network_config:
1212
name: {{ network_info.public_ipv4.interface }}
1313
primary: true
1414
mtu: {{ public_mtu }}
15+
{% if public_default_route %}
16+
routes:
17+
- default: true
18+
next_hop: {{ network_info.public_ipv4.gateway }}
19+
{% endif %}
1520
{% if network_config is defined %}
1621
{{ network_config | to_nice_yaml }}
1722
{% else %}

playbooks/vars/defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ control_plane_ip: "{{ control_plane_cidr | nthhost(2) }}"
3232
# By default we use the default IP of the host
3333
public_api: "{{ network_info.public_ipv4.address }}"
3434

35+
# Whether or not manually create the default route via br-ex, in case it's not applicable via DHCP.
36+
public_default_route: false
37+
3538
# For advanced network configurations (e.g. SR-IOV), network_config can be overriden
3639
# The format is for os-net-config, check dev-install_net_config.yaml.j2 template.
3740
# network_config

0 commit comments

Comments
 (0)