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

bridge: T4569: Extend bridge.py for op-mode #1438

Merged
merged 1 commit into from Jul 29, 2022
Merged

Conversation

sever-sever
Copy link
Member

Change Summary

Extend bridge.py op-mode script, allow next commands to use own
op-mode functions
Add:

show bridge vlan
show bridge brX fdb
show bridge brX mdb

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

bridge

Proposed changes

How to test

Current output:

vyos@r14:~$ show bridge vlan
port              vlan-id  
eth1              1 PVID Egress Untagged
br0               1 PVID Egress Untagged
vyos@r14:~$ 
vyos@r14:~$ show bridge br0 fdb
52:54:00:38:cc:4f dev eth1 master br0 
52:54:00:c7:31:bc dev eth1 vlan 1 master br0 permanent
52:54:00:c7:31:bc dev eth1 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent
33:33:00:00:00:02 dev eth1 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
33:33:00:00:00:01 dev br0 self permanent
33:33:00:00:00:02 dev br0 self permanent
33:33:ff:00:00:01 dev br0 self permanent
33:33:ff:c7:31:bc dev br0 self permanent
01:00:5e:00:00:01 dev br0 self permanent
33:33:ff:00:00:00 dev br0 self permanent
33:33:00:00:00:05 dev br0 self permanent
33:33:00:00:00:06 dev br0 self permanent
vyos@r14:~$ 

New output:

vyos@r14:~$ show bridge vlan 
Interface      Vlan  Flags
-----------  ------  ---------------------
eth1              1  pvid, egress untagged
br0               1  pvid, egress untagged
vyos@r14:~$ 

vyos@r14:~$ show bridge br0 fdb 
Interface    Mac address        State      Flags
-----------  -----------------  ---------  -------
eth1         52:54:00:38:cc:4f
eth1         52:54:00:c7:31:bc  permanent
eth1         52:54:00:c7:31:bc  permanent
eth1         33:33:00:00:00:01  permanent  self
eth1         33:33:00:00:00:02  permanent  self
eth1         01:00:5e:00:00:01  permanent  self
br0          33:33:00:00:00:01  permanent  self
br0          33:33:00:00:00:02  permanent  self
br0          33:33:ff:00:00:01  permanent  self
br0          33:33:ff:c7:31:bc  permanent  self
br0          01:00:5e:00:00:01  permanent  self
br0          33:33:ff:00:00:00  permanent  self
br0          33:33:00:00:00:05  permanent  self
br0          33:33:00:00:00:06  permanent  self
vyos@r14:~$ 

Raw format:

vyos@r14:~$ /usr/libexec/vyos/op_mode/bridge.py show_vlan --raw
[
    {
        "ifname": "eth1",
        "vlans": [
            {
                "vlan": 1,
                "flags": [
                    "PVID",
                    "Egress Untagged"
                ]
            }
        ]
    },
    {
        "ifname": "br0",
        "vlans": [
            {
                "vlan": 1,
                "flags": [
                    "PVID",
                    "Egress Untagged"
                ]
            }
        ]
    }
]
vyos@r14:~$ 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Extend bridge.py op-mode script, allow next commands to use own
op-mode functions
Add:
show bridge vlan
show bridge brX fdb
show bridge brX mdb
@c-po c-po merged commit b5d9ebf into vyos:current Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants