Config interface Loopback0 ip add/del is not working #443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
In main.py, parse Loopback interface and send the config to Config DB
- How I did it
Update the add/remove routines to add/del addresses on Loopback0 interface.
- How to verify it
root@sonic:/home/admin# config interface Loopback0 ip add 28.28.28.28/32
root@sonic:/home/admin# ip route show table local | grep "dev 28.28.28.28"
local 28.28.28.28 dev lo proto kernel scope host src 28.28.28.28
root@sonic:/home/admin# config interface Loopback0 ip add 2037::1/128
root@sonic:/home/admin# ip -6 route show | grep 2037::1
unreachable 2037::1 dev lo proto kernel metric 256 error -101 pref medium
root@sonic:/home/admin# show runningconfiguration all | grep Loopback0
"Loopback0|28.28.28.28/32": {},
"Loopback0|2037::1/128": {},
root@sonic:/home/admin# bcmcmd 'l3 defip show'
l3 defip show
Unit 0, Total Number of DEFIP entries: 8192
VRF Net addr Next Hop Mac INTF MODID PORT PRIO CLASS HIT VLAN
.....
514 0 28.28.28.28/32 00:00:00:00:00:00 100003 0 0 0 1 n
.....
root@sonic:/home/admin# bcmcmd 'l3 ip6route show'
l3 ip6route show
Unit 0, Total Number of IPv6 entries: 6144 (IPv6/64 4096, IPv6/128 2048)
Max number of ECMP paths 64
Free IPv6 entries available: 6127 (IPv6/64 4087, IPv6/128 2040)
VRF Net addr Next Hop Mac INTF MODID PORT PRIO CLASS HIT VLAN
....
7 0 2037:0000:0000:0000:0000:0000:0000:0001/128 00:00:00:00:00:00 100003 0 0 0 1 n
....
root@sonic:/home/admin# config interface Loopback0 ip remove 28.28.28.28/32
root@sonic:/home/admin# ip route show table local | grep "28.28.28.28"
root@sonic:/home/admin# config interface Loopback0 ip remove 2037::1/128
root@sonic:/home/admin# ip -6 route show | grep 2037::1
root@sonic:/home/admin#
- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)
-->
Details if related
Along with change in main.py, this issue needed a change in cfgmgr/intfmgr.cpp in sonic-swss repo (tracked via PR sonic-net/sonic-swss#767).