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

Ensuring ipv4 config ahead of ipv6 in /etc/network/interfaces file for mgmt interface #1544

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions src/sonic-config-engine/tests/sample_output/interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ iface eth0 inet static
down ip -4 route delete 10.0.0.0/24 dev eth0 table default
down ip -4 rule delete from 10.0.0.100/32 table default
iface eth0 inet6 static
address 2603:10e2:0:2902::8
address 603:10e2:0:2902::8
netmask 64
########## management network policy routing rules
# management port up rules
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
up ip -6 rule add from 2603:10e2:0:2902::8/128 table default
up ip -6 route add default via 603:10e2:0:2902::1 dev eth0 table default
up ip -6 route add 603:10e2:0:2902::/64 dev eth0 table default
up ip -6 rule add from 603:10e2:0:2902::8/128 table default
# management port down rules
down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default
down ip -6 route delete default via 603:10e2:0:2902::1 dev eth0 table default
down ip -6 route delete 603:10e2:0:2902::/64 dev eth0 table default
down ip -6 rule delete from 603:10e2:0:2902::8/128 table default
#
# The switch front panel interfaces
# "|| true" is added to suppress the error when interface is already a member of LAG
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-config-engine/tests/t0-sample-graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@
<Name>HostIP</Name>
<AttachTo>eth0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>2603:10e2:0:2902::8/64</b:IPPrefix>
<b:IPPrefix>603:10e2:0:2902::8/64</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>2603:10e2:0:2902::8/64</a:PrefixStr>
<a:PrefixStr>603:10e2:0:2902::8/64</a:PrefixStr>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change the ipv6 address such that without the sort_by_prefix filter, the interfaces.j2 template will place ipv6 profile ahead of ipv4:

--- sample_output/interfaces 2018-04-02 21:28:10.122688400 +0000
+++ /home/localadmin/interfaces 2018-04-02 23:36:40.086688400 +0000
@@ -17,6 +17,18 @@
#
# The management network interface
auto eth0
+iface eth0 inet6 static
+ address 603:10e2:0:2902::8
+ netmask 64
+ ########## management network policy routing rules
+ # management port up rules
+ up ip -6 route add default via 603:10e2:0:2902::1 dev eth0 table default
+ up ip -6 route add 603:10e2:0:2902::/64 dev eth0 table default
+ up ip -6 rule add from 603:10e2:0:2902::8/128 table default
+ # management port down rules
+ down ip -6 route delete default via 603:10e2:0:2902::1 dev eth0 table default
+ down ip -6 route delete 603:10e2:0:2902::/64 dev eth0 table default
+ down ip -6 rule delete from 603:10e2:0:2902::8/128 table default
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
@@ -31,18 +43,6 @@
down ip -4 route delete 10.0.0.0/24 dev eth0 table default
down ip -4 rule delete from 10.0.0.100/32 table default
down ip rule delete to 10.20.6.16/32 table default
-iface eth0 inet6 static
- address 2603:10e2:0:2902::8
- netmask 64
- ########## management network policy routing rules
- # management port up rules
- up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default
- up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
- up ip -6 rule add from 2603:10e2:0:2902::8/128 table default
- # management port down rules
- down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
- down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
- down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default
#
# The switch front panel interfaces
# "|| true" is added to suppress the error when interface is already a member of LAG

</a:ManagementIPInterface>
</ManagementIPInterfaces>
<ManagementVIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
Expand Down