Comware

 View Only
last person joined: 12 hours ago 

Expand all | Collapse all

comware - role name

This thread has been viewed 23 times
  • 1.  comware - role name

    Posted Dec 08, 2021 02:44 AM
    hello

    how i create  role to authorize only edit interface ten 1/1/13 and do shut and bo shutdown ?


    i try this one

    role name edit-inter-1-1-13

    rule 3 permit command "interface Ten-GigabitEthernet1/1/13"
    rule 4 permit command shutdown
    rule 5 permit command no shutdown
    rule 6 deny command *


    local-user TEST class manage
    password hash xxx
    service-type https ssh
    authorization-attribute user-role edit-inter-1-1-13


    best regard

    gadi



    ------------------------------
    Gadi Sontag
    ------------------------------


  • 2.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 02:54 AM
    Hi Gadi,

    What is the configuration of VTY lines? The one starting with 'line vty 0 63'.

    Also, could you specify how exactly this config doesn't work - how do you test it, does CLI accept all commands or no commands at all?


    ------------------------------
    Ivan Bondar
    ------------------------------



  • 3.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 05:17 AM
    Hi Gadi,

    Here is the solution:

    #
    line vty 0 63
     authentication-mode scheme
     user-role network-operator
    #
    role name edit-inter-1-1-13
     rule 3 permit command system-view ; interface * ; shutdown
     rule 4 permit command system-view ; interface * ; undo shutdown
     interface policy deny
      permit interface GigabitEthernet1/1/13
    #
    domain system
     authentication login local
     authorization login local
     accounting default none
    #
     domain default enable system
    #
    local-user TEST class manage
     password hash <removed>
     service-type ssh https
     authorization-attribute user-role edit-inter-1-1-13
     undo authorization-attribute user-role network-operator
    ​

    Let me know if it works for you.


    ------------------------------
    Ivan Bondar
    ------------------------------



  • 4.  RE: comware - role name

    Posted Dec 08, 2021 06:52 AM

    Hello

     

    I try this solution

     

    1.       Lets shutdown  all interfaces L

    2.       Unable to perform undo shutdown

    Attach a config

     

     

    role name edit-inter-1-1-13

    rule 3 permit command system-view ; interface * ; shutdown 

     rule 4 permit command system-view ; interface * ; undo shutdown interface policy deny permit interface GigabitEthernet1/1/13

    rule 5 permit command system-view ; interface * ; undo shutdown interface policy deny permit interface GigabitEthernet1/2/3

     

    %xxxx    SHELL/5/SHELL_CMDDENY: -Line=vty0-IPAddr=xxx-User=xxx; Command undo shutdown is permission denied.

    Best regard

    <\\\\\/////>

                          /   ^    \

                         ( (o) (o) )

    ====oOOO====(_)====OOOo==========

    Gadi sontag

    Tel:    972-3-9275228

    Mob:  972-52-5656228

    E. mail:        gadis@ladpc.co.il

    Visit our site : http://www.ladpc.co.il

    ===============Oooo.==============

                        .oooO  (   )

                         (   )     ) /

                          \ (    (_/

     






  • 5.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 07:03 AM
    Maybe it is formatting issue, but this is completely wrong:

    rule 4 permit command system-view ; interface * ; undo shutdown interface policy deny permit interface GigabitEthernet1/1/13​


    You didn't get the idea. The role has only two rules:

     rule 3 permit command system-view ; interface * ; shutdown
     rule 4 permit command system-view ; interface * ; undo shutdown​

    and one interface policy that defines which interfaces are accessible:

    interface policy deny
     permit interface GigabitEthernet1/1/13
     permit interface GigabitEthernet1/2/3
    


    The logic behind this is very simple - 'permit command' defines which commands are available. In our case those are two commands from interface context - 'shutdown' and 'undo shutdown'. These rules have global meaning, for all interfaces. And only then you define which interfaces are accessible by the user, for this purpose you use 'interface policy deny' context under which you 'permit' interfaces that should be accessible for the user. Thus you achieve your target - allow 'shutdown' and 'undo shutdown' commands, but only for certain interfaces.

    Here is how the role should look like:

    #
    role name edit-inter-1-1-13
     rule 3 permit command system-view ; interface * ; shutdown
     rule 4 permit command system-view ; interface * ; undo shutdown
     interface policy deny
      permit interface GigabitEthernet1/1/13
      permit interface GigabitEthernet1/2/3
    #​


    ------------------------------
    Ivan Bondar
    ------------------------------



  • 6.  RE: comware - role name

    Posted Dec 08, 2021 10:01 AM

    Hi

     

    Thank you

     

     

    I try

     

    role name edit-inter-1-1-13

    rule 1 permit command system-view ; interface  ;

    rule 2 permit command system-view ; shutdown ;

    rule 3 permit command system-view ; no shutdown ;

    interface policy deny

      permit interface Ten-GigabitEthernet1/2/3

     

     

     

    when I connect with user

     

    %Dec  8 16:57:26:446 2021 xxx  SHELL/5/SHELL_CMDDENY: -Line=vty1-IPAddr=10.236.33.39-User=test ; Command interface ten-GigabitEthernet1/2/3 is permission denied.

     

     

    https://techhub.hpe.com/eginfolib/networking/docs/switches/7500/5200-1928a_fund_cr/content/495506813.htm

     

    best regard

     

    <\\\\\/////>

                          /   ^    \

                         ( (o) (o) )

    ====oOOO====(_)====OOOo==========

    Gadi sontag

    Tel:    972-3-9275228

    Mob:  972-52-5656228

    E. mail:        gadis@ladpc.co.il

    Visit our site : http://www.ladpc.co.il

    ===============Oooo.==============

                        .oooO  (   )

                         (   )     ) /

                          \ (    (_/

     






  • 7.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 10:05 AM
    Could you provide your device model number (starting from letter 'J') and software version running? I will check.

    ------------------------------
    Ivan Bondar
    ------------------------------



  • 8.  RE: comware - role name

    Posted Dec 08, 2021 10:11 AM

    Hello

     

    HPE FF 5940 2-slot Switch

    Description

    HPE Comware Platform Software, Software Version 7.1.070, Release 2510P02 HPE FF 5940 2-slot Switch Copyright (c) 2010-2017 Hewlett Packard Enterprise Development LP

     

     

    Best regard

     

    <\\\\\/////>

                          /   ^    \

                         ( (o) (o) )

    ====oOOO====(_)====OOOo==========

    Gadi sontag

    Tel:    972-3-9275228

    Mob:  972-52-5656228

    E. mail:        gadis@ladpc.co.il

    Visit our site : http://www.ladpc.co.il

    ===============Oooo.==============

                        .oooO  (   )

                         (   )     ) /

                          \ (    (_/

     






  • 9.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 10:16 AM
    I will check 5940, no problem, but could you let me know if you tested the configuration I gave you? Because the one you try is not the one I provided. 

    This is WRONG:
    rule 1 permit command system-view ; interface  ;
    rule 2 permit command system-view ; shutdown ;
    rule 3 permit command system-view ; no shutdown ;​

    This is CORRECT:
     rule 1 permit command system-view ; interface * ; shutdown
     rule 2 permit command system-view ; interface * ; undo shutdown​​

    Please, let's agree on the baseline, the simplest WORKING config and just then you will use your creativity to fine-tune it :-)




    ------------------------------
    Ivan Bondar
    ------------------------------



  • 10.  RE: comware - role name

    Posted Dec 08, 2021 10:40 AM

    Hello

     

    role name edit-inter-1-1-13

    rule 1 permit command system-view ; interface * ; shutdown

    rule 2 permit command system-view ; interface * ; undo shutdown

    interface policy deny

      permit interface Ten-GigabitEthernet1/1/13

    #

     

     

    It is work !!!

     

    Thank you very much

     

    Best regard

     

     

     

     

    <\\\\\/////>

                          /   ^    \

                         ( (o) (o) )

    ====oOOO====(_)====OOOo==========

    Gadi sontag

    Tel:    972-3-9275228

    Mob:  972-52-5656228

    E. mail:        gadis@ladpc.co.il

    Visit our site : http://www.ladpc.co.il

    ===============Oooo.==============

                        .oooO  (   )

                         (   )     ) /

                          \ (    (_/

     






  • 11.  RE: comware - role name

    EMPLOYEE
    Posted Dec 08, 2021 10:43 AM
    You are welcome, Gadi! :-)


    ------------------------------
    Ivan Bondar
    ------------------------------