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

Loopback interface configuration CLIs #879

Merged
merged 30 commits into from
May 21, 2020
Merged

Loopback interface configuration CLIs #879

merged 30 commits into from
May 21, 2020

Conversation

preetham-singh
Copy link
Contributor

@preetham-singh preetham-singh commented Apr 16, 2020

- What I did
Adding Configuration CLI to create loopback interfaces
Adding Show cli: show interfaces loopback to print list of loopback interfaces created with VRF binding information from config-db.

  • Examples:

    admin@sonic:~$ sudo config loopback add Loopback11
    
    admin@sonic:~$ show interfaces loopback
    Name         VRF
    -----        -------
    Loopback0           
    Loopback11
    Loopback100  Vrf-10 
    Loopback101         
    Loopback102  Vrf-10 
    
    config interface vrf bind Loopback11 Vrf-11
    
    admin@sonic:~$ show interfaces loopback
    Name         VRF
    -----        -------
    Loopback0           
    Loopback11   Vrf-11 
    Loopback100  Vrf-10 
    Loopback101         
    Loopback102  Vrf-10 
    

- How I did it

- How to verify it

Create Loopback using:
config loopback add Loopback
config loopback del Loopback where id is loopback id in range <0-999>
show interfaces loopback [Loopback] [--verbose] Prints loopback interfaces configured by user by fetching information from config-db. If --verbose option provided, it prints IP configured on corresponding Loopback interface by fetching information from config-db.

- 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)

@lgtm-com
Copy link

lgtm-com bot commented Apr 16, 2020

This pull request introduces 1 alert when merging 6b08911f8ba54d50b6220e1a7d1242453299c115 into 3f651dc - view on LGTM.com

new alerts:

  • 1 for Unnecessary pass

@lgtm-com
Copy link

lgtm-com bot commented Apr 16, 2020

This pull request introduces 1 alert when merging a9495b43c67db1bd38f477ded18c1269821f3666 into 3f651dc - view on LGTM.com

new alerts:

  • 1 for Unnecessary pass

@jleveque
Copy link
Contributor

@preetham-singh: Please fix LGTM alert.

@prsunny
Copy link
Contributor

prsunny commented Apr 24, 2020

@preetham-singh, can you resolve conflict? Also could you provide the show command output in description for the commands you introduced? You can refer - #880

@preetham-singh
Copy link
Contributor Author

@preetham-singh, can you resolve conflict? Also could you provide the show command output in description for the commands you introduced? You can refer - #880

Thanks @prsunny . I have resolved conflicts and updated the commit with show output examples.

show/main.py Outdated Show resolved Hide resolved
eth0 10.3.147.252/23 up/up N/A N/A
lo 127.0.0.1/8 up/up N/A N/A
Interface IPv4 address/mask Master Admin/Oper BGP Neighbor Neighbor IP Flags
------------- ------------------- ------------ -------------- ------------- ------------- -------
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that Master is second column - ref . I don't see a code change. Please correct the output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Vlan100 fe80::eef4:bbff:fefe:880a%Vlan100/64 up/up N/A N/A
eth0 fe80::eef4:bbff:fefe:880a%eth0/64 up/up N/A N/A
lo fc00:1::32/128 up/up N/A N/A
Interface IPv6 address/mask Master Admin/Oper BGP Neighbor Neighbor IP
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated
# 'show interfaces loopback' group command
#
#
@interfaces.command()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to have this command output. IMO, all of this is available in show ip interfaces. show interfaces is mostly the Layer 2 info. I think this command is redundant. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a internal request to add command to list loopback interfaces created since show ip interface would show only if IP was assigned. Hence we planned to add this command. If this is not necessary I can remove this command and update. Please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, it is better to avoid any duplicates. This file is already pretty big. Could you please remove this command since in most cases, loopback will be assigned with an IP address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

show/main.py Outdated
for lo in natsorted(loopbacks):
if type(lo) == tuple:
continue
intf_vrf = get_intf_master(lo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use get_if_master

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

yxieca and others added 17 commits May 12, 2020 10:08
- This flag is currently no functional impact with just this change.
- This flag is intended to coordinate fast-reboot shutdown path.
- This flag enables moving fast-reboot per service knowledge to service scripts.
  which unblocks moving warm-reboot per service knowledge to service scripts.
- This flag is consistent with the bootup flag we setting on the boot up path.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
* [utility] Filter FDB entries

FDB table can get large due to VM creation/deletion which cause
fast reboot to slow down. This utility fitlers FDB entries based on
current MAC entries in the ARP table.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
…ot user (#872)

Removed user privileges checks. These changes fix #800. The ZTP PR sonic-net/sonic-ztp#13 is also required for these changes to work as expected.

```
admin@sonic:~$ show ztp status
ZTP Admin Mode : True
ZTP Service : Processing
ZTP Status : IN-PROGRESS
ZTP Source : local-fs (/host/ztp/ztp_data_local.json)
Runtime : 06m 26s
Timestamp : 2020-04-08 13:08:22 UTC

ZTP Service is active

01-test-plugin: IN-PROGRESS
```

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
* ssd_mitigation_changes

* ssd_mitigation_changes

* ssd_mitigation_changes
* Changes:
1) Add syslog support.
2) Enable forever periodic scan
3) Skip link local addresses
4) Skip eth0 routes
3) Adopt to 20191130 changes
    3.1) APPl-DB INTF_TABLE may not have IP address
    3.2) nexthop is never empty

* No logical code change. A small name change.

* 1) Adopt to 201811 -- Filter out 'lo' & 'docker0' in addition to 'eth0' as local routes
2) Ensure to read route entry w/o prefix, if not present with prefix
* [Phase 1] Multi ASIC config command changes, db_mgrator.py script updates for handing namespace.

* Fixes and comment updates

* Comments addressed + added support for user to input the config files per namespace also.

* Updates per comments + based on the updated SonicV2Connector/ConfigDBConnector class design

* Review comments update.

* Help string updated for config save/reload/load
* Fix NameError for 'swsssdk', align neig output
- Modify the load_minigraph command handler to support multi NPU platforms
…ers' group (#900)

Co-authored-by: Travis Van Duyn <trvanduy@microsoft.com>
yangshp1987 and others added 3 commits May 12, 2020 10:10
Signed-off-by: yangshiping <yangshiping@jd.com>
output.
Reusing existing get_intf_master to get vrf binding for the interface
@prsunny
Copy link
Contributor

prsunny commented May 12, 2020

can you do a rebase?

@preetham-singh
Copy link
Contributor Author

can you do a rebase?

Done

@prsunny
Copy link
Contributor

prsunny commented May 18, 2020

@preetham-singh , can you update the description as there is no new show CLI

@preetham-singh preetham-singh changed the title Loopback interface configuration and show CLIs Loopback interface configuration CLIs May 19, 2020
@prsunny prsunny merged commit 10c7ba1 into sonic-net:master May 21, 2020
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
* Adding configuration CLIs for loopback interfaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.