Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/image_config/interfaces/interfaces.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ iface lo {{ 'inet' if prefix | ipv4 else 'inet6' }} static
# The management network interface
auto eth0
{% if MGMT_INTERFACE %}
{% for (name, prefix) in MGMT_INTERFACE %}
{% for (name, prefix) in MGMT_INTERFACE|sort %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why sort put v4 ahead of v6? is that a co-incidence?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name field is the same, eth0, for both v4 and v6. The sort is based on what is taken in the prefix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no guarantee that v4 prefix will be ahead of v6 prefix.

iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static
address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
Expand Down