Skip to content

[interfaces] Use "Vlan"+tag instead of name for linux vlan device names #1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
6 changes: 3 additions & 3 deletions files/image_config/interfaces/interfaces.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
allow-hotplug {{ member }}
iface {{ member }} inet manual
pre-up ifconfig {{ member }} up mtu 9100
post-up brctl addif {{ vlan }} {{ member }} || true
post-up brctl addif Vlan{{ VLAN[vlan]['vlanid'] }} {{ member }} || true
Copy link
Contributor

Choose a reason for hiding this comment

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

how do we assign a VLAN ID if the VLAN name is not a number?

post-down ifconfig {{ member }} down
#
{% endfor %}
Expand All @@ -87,8 +87,8 @@ iface {{ member }} inet manual
{% if VLAN_INTERFACE %}
# Vlan interfaces
{% for (name, prefix) in VLAN_INTERFACE.keys() | sort %}
auto {{ name }}
iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
auto Vlan{{ VLAN[name]['vlanid'] }}
iface Vlan{{ VLAN[name]['vlanid'] }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
bridge_ports none
address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
Expand Down