Skip to content
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

Fix Ubuntu etc/network/interfaces ordering #35

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
auto lo
iface lo inet loopback

{% if osinfo.distro == 'ubuntu' %}
{% for iface in interfaces %}
auto {{ iface.name }}
iface {{ iface.name }} inet manual
{% if iface.name != interfaces[0].name %}
pre-up sleep 4
{% endif %}
bond-master bond0

{% endfor %}
{% endif %}
auto bond0
iface bond0 inet static
{% if ip4pub %}
Expand Down Expand Up @@ -41,14 +52,3 @@ iface bond0:0 inet static
post-down route del -net {{ subnet }} gw {{ ip4priv.gateway }}
{% endfor %}
{% endif %}
{% if osinfo.distro == 'ubuntu' %}
{% for iface in interfaces %}

auto {{ iface.name }}
iface {{ iface.name }} inet manual
{% if iface.name != interfaces[0].name %}
pre-up sleep 4
{% endif %}
bond-master bond0
{% endfor %}
{% endif %}
72 changes: 36 additions & 36 deletions packetnetworking/distros/debian/test_ubuntu_1404_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def test_ubuntu_1404_public_bonded_task_etc_network_interfaces(
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4pub.address}
Expand All @@ -46,15 +55,6 @@ def test_ubuntu_1404_public_bonded_task_etc_network_interfaces(
netmask {ipv4priv.netmask}
post-up route add -net 10.0.0.0/8 gw {ipv4priv.gateway}
post-down route del -net 10.0.0.0/8 gw {ipv4priv.gateway}

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4pub=builder.ipv4pub.first,
Expand Down Expand Up @@ -83,6 +83,15 @@ def test_ubuntu_1404_private_bonded_task_etc_network_interfaces(
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4priv.address}
Expand All @@ -97,15 +106,6 @@ def test_ubuntu_1404_private_bonded_task_etc_network_interfaces(
bond-slaves {iface0.name} {iface1.name}
dns-nameservers {dns1} {dns2}


auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4priv=builder.ipv4priv.first,
Expand All @@ -130,6 +130,15 @@ def test_ubuntu_1404_public_bonded_task_etc_network_interfaces_with_custom_priva
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4pub.address}
Expand All @@ -156,15 +165,6 @@ def test_ubuntu_1404_public_bonded_task_etc_network_interfaces_with_custom_priva
post-down route del -net 192.168.5.0/24 gw {ipv4priv.gateway}
post-up route add -net 172.16.0.0/12 gw {ipv4priv.gateway}
post-down route del -net 172.16.0.0/12 gw {ipv4priv.gateway}

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4pub=builder.ipv4pub.first,
Expand Down Expand Up @@ -194,6 +194,15 @@ def test_ubuntu_1404_private_bonded_task_etc_network_interfaces_with_custom_priv
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4priv.address}
Expand All @@ -208,15 +217,6 @@ def test_ubuntu_1404_private_bonded_task_etc_network_interfaces_with_custom_priv
bond-slaves {iface0.name} {iface1.name}
dns-nameservers {dns1} {dns2}


auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4priv=builder.ipv4priv.first,
Expand Down
72 changes: 36 additions & 36 deletions packetnetworking/distros/debian/test_ubuntu_1604_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def test_ubuntu_1604_public_bonded_task_etc_network_interfaces(
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4pub.address}
Expand All @@ -46,15 +55,6 @@ def test_ubuntu_1604_public_bonded_task_etc_network_interfaces(
netmask {ipv4priv.netmask}
post-up route add -net 10.0.0.0/8 gw {ipv4priv.gateway}
post-down route del -net 10.0.0.0/8 gw {ipv4priv.gateway}

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4pub=builder.ipv4pub.first,
Expand Down Expand Up @@ -83,6 +83,15 @@ def test_ubuntu_1604_private_bonded_task_etc_network_interfaces(
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4priv.address}
Expand All @@ -97,15 +106,6 @@ def test_ubuntu_1604_private_bonded_task_etc_network_interfaces(
bond-slaves {iface0.name} {iface1.name}
dns-nameservers {dns1} {dns2}


auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4priv=builder.ipv4priv.first,
Expand All @@ -130,6 +130,15 @@ def test_ubuntu_1604_public_bonded_task_etc_network_interfaces_with_custom_priva
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4pub.address}
Expand All @@ -156,15 +165,6 @@ def test_ubuntu_1604_public_bonded_task_etc_network_interfaces_with_custom_priva
post-down route del -net 192.168.5.0/24 gw {ipv4priv.gateway}
post-up route add -net 172.16.0.0/12 gw {ipv4priv.gateway}
post-down route del -net 172.16.0.0/12 gw {ipv4priv.gateway}

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4pub=builder.ipv4pub.first,
Expand Down Expand Up @@ -194,6 +194,15 @@ def test_ubuntu_1604_private_bonded_task_etc_network_interfaces_with_custom_priv
auto lo
iface lo inet loopback

auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0

auto bond0
iface bond0 inet static
address {ipv4priv.address}
Expand All @@ -208,15 +217,6 @@ def test_ubuntu_1604_private_bonded_task_etc_network_interfaces_with_custom_priv
bond-slaves {iface0.name} {iface1.name}
dns-nameservers {dns1} {dns2}


auto {iface0.name}
iface {iface0.name} inet manual
bond-master bond0

auto {iface1.name}
iface {iface1.name} inet manual
pre-up sleep 4
bond-master bond0
"""
).format(
ipv4priv=builder.ipv4priv.first,
Expand Down
Loading