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

[202311] Fix IPV6 forced-mgmt-route not work issue #18045

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Feb 6, 2024

Fix IPV6 forced-mgmt-route not work issue
This is cherry-pick PR for #17299

Why I did it

IPV6 forced-mgmt-route not work

When add a IPV6 route, should use 'ip -6 rule add pref 32764 address' command, but currently in the template the '-6' parameter are missing, so the IPV6 route been add to IPV4 route table.

Also this PR depends on #17281 , which will fix the IPV6 'default' route table missing in IPV6 route lookup issue. 

Work item tracking
  • Microsoft ADO (number only):24719238

How I did it

Add IPV6 route with 'ip -6' command

How to verify it

Pass all UT
Manually verify:

// setup forced mgmt routes
admin@vlab-01:$ sonic-db-cli CONFIG_DB HSET "MGMT_INTERFACE|eth0|fec0::ffff:afa:1/64" forced_mgmt_routes@ "1110::ffff:afa:1/64"
1
admin@vlab-01:
$ sudo config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
admin@vlab-01:~$ sudo config reload -y
Disabling container monitoring ...
Stopping SONiC target ...

// check interface config update correctly
admin@vlab-01:~$ cat /etc/network/interfaces

...

iface eth0 inet6 static
address fec0::ffff:afa:1
netmask 64
network fec0::
broadcast fec0::ffff:ffff:ffff:ffff
########## management network policy routing rules
# management port up rules
up ip -6 route add default via fec0::1 dev eth0 table default metric 201
up ip -6 route add fec0::/64 dev eth0 table default
up ip -6 rule add pref 32765 from fec0::ffff:afa:1/128 table default
up ip -6 rule add pref 32764 to 1110::ffff:afa:1/64 table default <== force mgmt route added correctly with 'ip -6'

// check route tables:
admin@vlab-01:$ ip -6 rule list
1001: from all lookup local
32764: from all to 1110::ffff:afa:1/64 lookup default
32765: from fec0::ffff:afa:1 lookup default <== force mgmt route been add to IPV6 table
32766: from all lookup main
admin@vlab-01:
$

// traceroute command can find route
admin@vlab-01:~$ traceroute 1110::ffff:afa:1
traceroute to 1110::ffff:afa:1 (1110::ffff:afa:1), 30 hops max, 80 byte packets
1 * * *
2 * * *

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

  • master-17299.420743-d31987daa

Description for the changelog

Fix IPV6 forced-mgmt-route not work issue

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

ix IPV6 forced-mgmt-route not work issue

Why I did it
IPV6 forced-mgmt-route not work

When add a IPV6 route, should use 'ip -6 rule add pref 32764 address' command, but currently in the template the '-6' parameter are missing, so the IPV6 route been add to IPV4 route table.

Also this PR depends on sonic-net#17281 , which will fix the IPV6 'default' route table missing in IPV6 route lookup issue. 

Microsoft ADO (number only):24719238
@mssonicbld
Copy link
Collaborator

@liuh-80 PR: #18045 is conflict with MS internal repo
Please complete the following PR by pushing fix commit to sonicbld/conflict_prefix/18045-fix
https://msazure.visualstudio.com/One/_git/Networking-acs-buildimage/pullrequest/9479950
Then comment "/azpw ms_conflict" to rerun PR checker.

@liuh-80
Copy link
Contributor Author

liuh-80 commented Feb 7, 2024

/azpw ms_conflict

@liuh-80 liuh-80 marked this pull request as ready for review February 7, 2024 08:00
@liuh-80 liuh-80 requested a review from lguohan as a code owner February 7, 2024 08:00
@yxieca yxieca merged commit f4b1eb0 into sonic-net:202311 Feb 7, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants