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

[Vxlan] : adding show vnet/vxlan cmds #880

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

dzhangalibaba
Copy link
Contributor

@dzhangalibaba dzhangalibaba commented Apr 16, 2020

add some basic show cmds:

  • show vnet brief

  • show vnet name <vnetname>

  • show vnet interfaces

  • show vnet neighbors

  • show vnet routes all

  • show vnet routes tunnel

  • show vxlan tunnel

  • show vxlan name <vxlanname>

  • some example as below:

admin@ASW-7005:~$ show vnet brief
vnet name    vxlan tunnel      vni  peer list
-----------  --------------  -----  ------------------
Vnet_2000    tunnel1          2000
Vnet_3000    tunnel1          3000  Vnet_2000,Vnet4000
admin@ASW-7005:~$ show vnet name Vnet_3000
vnet name    vxlan tunnel      vni  peer list
-----------  --------------  -----  ------------------
Vnet_3000    tunnel1          3000  Vnet_2000,Vnet4000

admin@ASW-7005:~$ show vnet interfaces
vnet name    interfaces
-----------  ------------
Vnet_2000    Ethernet1
Vnet_3000    Vlan2000

admin@ASW-7005:~$ show vnet neighbors
Vnet_2000    neighbor     mac_address    interfaces
-----------  -----------  -------------  ------------
             11.11.11.11                 Ethernet1
             11.11.11.12                 Ethernet1

Vnet_3000    neighbor     mac_address        interfaces
-----------  -----------  -----------------  ------------
             20.20.20.20  aa:bb:cc:dd:ee:ff  Vlan2000
admin@ASW-7005:~$ show vnet routes tunnel
vnet name    prefix          endpoint    mac address        vni
-----------  --------------  ----------  -----------------  -----
Vnet_2000    100.100.1.1/32  10.10.10.1
Vnet_3000    100.100.2.1/32  10.10.10.2  00:00:00:00:03:04


admin@ASW-7005:~$ show vnet routes all
vnet name    prefix          nexthop    interface
-----------  --------------  ---------  -----------
Vnet_2000    100.100.3.0/24             Ethernet52
Vnet_3000    100.100.4.0/24             Vlan2000

vnet name    prefix          endpoint    mac address        vni
-----------  --------------  ----------  -----------------  -----
Vnet_2000    100.100.1.1/32  10.10.10.1
Vnet_3000    100.100.2.1/32  10.10.10.2  00:00:00:00:03:04

admin@ASW-7005:~$ show vxlan tunnel
vxlan tunnel name    source ip    destination ip    tunnel map name    tunnel map mapping(vni -> vlan)
-------------------  -----------  ----------------  -----------------  ---------------------------------
tunnel1              10.10.10.10
tunnel2              10.10.10.10  20.10.10.10       tmap1              1234 -> 100
tunnel3              10.10.10.10  30.10.10.10       tmap2              1235 -> 200

admin@ASW-7005:~$ show vxlan name tunnel3
vxlan tunnel name    source ip    destination ip    tunnel map name    tunnel map mapping(vni -> vlan)
-------------------  -----------  ----------------  -----------------  ---------------------------------
tunnel3              10.10.10.10  30.10.10.10       tmap2              1235 -> 200


Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com

@dzhangalibaba
Copy link
Contributor Author

@prsunny

@prsunny
Copy link
Contributor

prsunny commented Apr 16, 2020

Just a reminder to update command reference as well - https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md

@dzhangalibaba
Copy link
Contributor Author

retest this please

1 similar comment
@dzhangalibaba
Copy link
Contributor Author

retest this please

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

Lgtm - Few minor comments!

show/main.py Outdated
config_db = ConfigDBConnector()
config_db.connect()

header = ['<vnet_name>', 'neighbor', 'interfaces']
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also provide themac addressif its available in the attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added.

admin@ASW-7005:~$ show vnet neighbors 
Vnet_2000    neighbor     mac_address    interfaces
-----------  -----------  -------------  ------------
             11.11.11.11                 Ethernet1


Vnet_3000    neighbor     mac_address        interfaces
-----------  -----------  -----------------  ------------
             20.20.20.20  aa:bb:cc:dd:ee:ff  Vlan2000


@vxlan.command()
@click.argument('vxlan_name', required=True)
def name(vxlan_name):
"""Show vxlan name <vxlan_name> information"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you intend to have the name in command? Its different from the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the cmd is like : show vxlan name XXX, the description is not showing <>, correct it now.

@dzhangalibaba
Copy link
Contributor Author

Just a reminder to update command reference as well - https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md

updated

@prsunny prsunny merged commit a7b310e into sonic-net:master Apr 23, 2020
abdosi pushed a commit that referenced this pull request Apr 27, 2020
* [Vxlan] : adding show vnet/vxlan cmds
@dzhangalibaba dzhangalibaba deleted the showvxlan branch April 30, 2020 20:36
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
* [Vxlan] : adding show vnet/vxlan cmds
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[Vxlan] : adding show vnet/vxlan cmds (sonic-net#880)
[show][bgp] Use only 'show ip bgp' as the base and use bgp_frr_v4 file
for FRR routing stack (sonic-net#884)
[fast reboot] set a fast-reboot DB flag (sonic-net#887)
[show] Add 'ip/ipv6 bgp network' commands (sonic-net#888)
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.

3 participants