Skip to content

add show ip interfaces command #491

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

batmancn
Copy link

- What I did

I add a command show ip interfaces to display L3 interface informations like IP.

- How I did it

Extends 'intfutil' and 'show/main.py' to add this fuction.

- How to verify it

# show ip interfaces
  Interface               IP    Oper    Admin                                       Description
-----------  ---------------  ------  -------  ------------------------------------------------
  Ethernet8   192.168.2.1/24    down       up                                               N/A
 Ethernet12   192.168.3.1/24    down       up                                               N/A
 Ethernet16   192.168.4.1/24    down       up                                               N/A
 Ethernet20   192.168.5.1/24    down       up                                               N/A
 Ethernet24   10.132.13.2/24    down       up                                               N/A
 Ethernet48   10.130.12.2/24    down       up                                               N/A
 Ethernet80  10.131.131.1/24    down       up                                               N/A
 Ethernet84  10.131.132.1/24    down       up                                               N/A
 Ethernet88  10.131.133.1/24    down       up                                               N/A
 Ethernet92  10.131.134.1/24    down       up                                               N/A
 Ethernet96  10.131.135.1/24    down       up                                               N/A
Ethernet100  10.131.136.1/24    down       up                                               N/A
Ethernet104  10.131.137.1/24    down       up                                               N/A
Ethernet108  10.131.138.1/24    down       up                                               N/A
Ethernet192   10.131.32.1/24    down       up  ...
Ethernet196   10.131.33.1/24    down       up  ...
Ethernet200   10.131.34.1/24    down       up  ...
Ethernet204   10.131.35.1/24    down       up  ...
Ethernet208   10.131.36.1/24    down       up  ...
Ethernet212       fc00:1::32    down       up  ...
    docker0   240.127.1.1/24     N/A      N/A                                               N/A
       eth0  172.18.8.213/24     N/A      N/A                                               N/A
         lo       10.131.3.1     N/A      N/A                                               N/A

@ip.command()
@click.argument('interfaces', required=False)
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def interfaces(interfaces, verbose):
Copy link
Contributor

Choose a reason for hiding this comment

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

The command show ip interfaces already exists (it is the next command in this file, just below the get_if_admin_state() and get_if_oper_state() helper functions--line 898 in your modified file).

You're welcome to extend the existing command, but this PR is literally creating a second implementation of show ip interfaces.

Copy link
Contributor

Choose a reason for hiding this comment

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

@batmancn: Have you seen my comment above? I suggest you close this PR and open a new one if you would like to extend the functionality of the existing show ip interfaces command.

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.

2 participants