Jump to content

Recommended Posts

Posted

Здравствуйте! Подскажите, как можно разграничить уровни доступа на коммутаторы S2985G?

Создаю enable password level 1 7 password

Пользователи по radius авторизуются и получают уровень доступа 1. А вот как им прописать разрешенные команды? Пробую что-то вроде:

privilege interface-ether level 1 switchport ... ... ... - коммутатор говорит Illegal command :switchport ... ... ... (точки это разные доп слова типа mode, access, vlan)

Пока получилось добавить только вот эти две:

privilege interface-ether level 1 shutdown и privilege interface-ether level 1 no shutdown. Но пользователю до них не добраться, так как он не может перейти в режим конфигурации.

Как мне добавить пользователю доступ к режиму конфигурации и только к секции interfaces ?

 

А ещё не могу удалить команды:

privilege exec level 1 all
privilege config level 1 all
privilege interface-ether level 1 all

Делаю no - и на каждую из них выдаёт: Illegal command :all

 

SNR-S2985G-48T Device 

SoftWare Version 7.0.3.5(R0241.0519)
BootRom Version 7.2.40

 

Posted

@ATX-250 Добрый день, такая возможность есть. Приведу пример настройки некоторых фич.

 

Создадим двух пользователей с разными привилегиями и разграничим их права:

switch(config)#username test1 privilege 1 password test1
switch(config)#username test5 privilege 5 password test5
switch(config)#privilege config level 15 all
switch(config)#privilege interface-ether level 15 all
switch(config)#privilege exec level 5 config
switch(config)#privilege config level 5 interface ethernet 1/0/1
switch(config)#privilege interface-ether level 5 no shutdown
switch(config)#privilege interface-ether level 5 shutdown
switch(config)#privilege exec level 1 show run
switch(config)#privilege exec level 1 show ver


Установим пароль на admin режим, дающий привилегию 15:

switch(config)#enable password sUpEr-AdMiN++

 

Проверим права пользователя с привилегией 1:

switch>sh privilege
Current privilege level is 1
switch>show ver | i SoftWare
SoftWare Package Version 7.5.3.2(R0004.0377)
switch>show run | i sysLocation
sysLocation Building 57/2,Predelnaya st,
Ekaterinburg, Russia
switch>conf
^
% Invalid input detected at '^' marker.

 

Проверим права пользователя с привилегией 5:

switch>conf
switch(config)>?
Configure commands:
  show                    Show running system information
  end                       End current mode and change to EXEC mode
  exit                       End current mode and down to previous mode
  help                      Description of the interactive help system
  interface                Select an interface to configure

switch(config)>interface ethernet 1/0/5
switch(config-if-ethernet1/0/5)>?
 commands:
   show                       Show running system information
   end                         End current mode and change to EXEC mode
   exit                          End current mode and down to previous mode
   help                        Description of the interactive help system
   no                          Negate a command or set its defaults
   shutdown               Shutdown the selected interface

 

Posted (edited)

Здравствуйте!

Просто скопировал ваши команды, проверяю:

 

username test5 privilege 5 password 7 e3d704f3542b44a621ebed70dc0efe13
privilege config level 1  interface ethernet all
privilege exec level 5  config
privilege config level 5  interface ethernet 1/0/1
privilege interface-ether level 5  no shutdown
privilege interface-ether level 5  shutdown

>show pri
Current privilege level is 5
(config)>?
Configure commands:
  show                       Show running system information
  aaa                        Configure AAA(Authentication, Authorization and pre-Accounting)
  aaa-accounting             Accounting configurations
  access-list                Add an access list entry
  accounting                 Accounting configuration commands
  am                         Configure AM
  anti-arpscan               Anti-arpscan
  arp                        Arp
  authentication             Authentication configuration commands
  authorization              Authorization configuration commands
  banner                     Define a login banner
  bpdu-tunnel                Bpdu-tunnel
  bpdu-tunnel-protocol       Bpdu-tunnel
  captive-portal             Enter captive portal mode.
  class-map                  Configure QoS Class Map
  clock                      Set clock
  cluster                    Cluster configuration commands
  cpu-rx-limitnotify         cpu-rx-limitNotify
  cpu-rx-ratelimit           CPU received traffic rate limit
  delete                     delete
  dns                        DNS
  dns-server                 Set a Nameserver to the DNS
  dosattack-check            Dosattack
  dot1x                      Configure 802.1X
  dynamic-vlan               Configure dynamic vlan
  enable                     Modify enable password parameters
  end                        End current mode and change to EXEC mode
  erps-ring                  Ethernet ring running G.8032
  errp                       errp
  ethernet                   Ethernet
  exec-timeout               Set timeout value
  exit                       End current mode and down to previous mode
  firewall                   Configure firewall status
  flowctrl-special           set flowctrl
  ftp-server                 FTP Server config
  fulleaps                   FULL Ethernet Automatic Protection Switching
  garp                       Set GARP parameter
  gvrp                       Set GVRP parameter
  hardware-address-list      Permit DHCP adding option 66 or 150 or 14x to the client in the hardware-address-list
  help                       Description of the interactive help system
  history                    Set history related parameters
  hostname                   Modify hostname
  interface                  Select an interface to configure
  ip                         IP information
  ipv6                       IPv6 information
  isolate-port               Isolate-port information
  key                        Authentication key management
  l2-address-table           L2 address table setting
  l3-station-move            Configure l3-station-move
  lacp                       Lacp configuration
  link-flap                  port link flap detection
  lldp                       Link Layer Discovery Protocol
  load-balance               Load balancing method
  logging                    Logging
  login                      Enable password checking
  loopback-detection         Loopback-detection
  mac-access-list            Global MAC configuration subcommands_Named access-list
  mac-address                Mac address config
  mac-address-learning       Mac address-learning config
  mac-address-table          MAC address table setting
  mac-authentication-bypass  Configure MAC authentication bypass feature
  mac-ip-access-list         Global MAC-IP configuration subcommands_Named access-list
  mac-vlan                   Configure mac vlan
  mls                        Configure MultiLayer Switching characteristics
  monitor                    Configure SPAN monitoring
  mrpp                       Multi-layer Ring Protection Protocol
  mtu                        Maximum Transmission Unit
  multicast                  Multicast config
  multicast-forwarding       multicast-forwarding configure
  multicast-vlan             Configure multicast vlan
  no                         Negate a command or set its defaults
  ntp                        Network time protocol
  ntp-service                ntp-service
  password                   Assign the terminal connection password
  policy                     Policy
  policy-map                 Configure QoS Policy Map
  port-group                 Port-group configuration
  port-led                   port led
  port-rate-statistics       port-rate-statistics
  port-redirect              Port-redirect
  port-scan-mode             Port-scan-mode
  pppoe                      PPPOE intermediate Agent
  privilege                  Set user privilege level
  profile-id                 Add an profile list entry
  protocol-vlan              Configure protocol vlan
  radius                     Configure RADIUS
  radius-server              Configure RADIUS server
  rmon                       Config rmon
  savi                       Source Address Validation Improvements
  service                    Modify use of network based services
  service-policy             Configure QoS Service Policy
  set                        Set
  sflow                      Sflow Global Configuration
  show                       Show running system information
  snmp-server                Modify SNMP parameters
  sntp                       Simple Network Time protocol
  spanning-tree              Spanning-tree config
  ssh-server                 Ssh service config command
  storm-control              Storm-control
  subnet-vlan                Configure Subnet vlan
  sysContact                 sysContact
  sysLocation                SysLocation
  tacacs-server              Config tacacs+ server
  telnet-server              Telnet server
  tftp-server                TFTP Server config
  time-range                 Configure a time range
  transceiver-monitoring     Transceiver monitoring
  uldp                       ULDP information
  ulpp                       Uplink Protection Protocol
  ulsm                       Uplink State Monitor
  userdefined-access-list    Specify userdefined access list
  username                   Establish User Name Authentication
  userpassword               Specifies the password for the user
  vacl                       Configure Vlan Acl
  vlan                       Vlan Commands
  vlan-port-redirect         vlan-port-redirect
  vlan-trunk-range           vlan-trunk-range
  vlan-trunking              Vlan trunking
  voice-vlan                 Configure voice vlan
  web                        Config web

Что я делаю не так?

 

И я всё равно не могу удалить команды

privilege exec level 1 all
privilege config level 1 all
privilege interface-ether level 1 all

Там где слово all - не удаляются.

Edited by ATX-250
Posted

@ATX-250 Вы не полностью скопировали команды:

username test5 privilege 5 password 7 e3d704f3542b44a621ebed70dc0efe13
privilege config level 1  interface ethernet all
privilege exec level 5  config
privilege config level 5  interface ethernet 1/0/1
privilege interface-ether level 5  no shutdown
privilege interface-ether level 5  shutdown
Posted

Но кто бы мог подумать, что для установки привилегий уровня 1 или 5 нужно задавать привилегии для уровня 15 :)

Добавил эти команды:privilege config level 15 all и privilege interface-ether level 15 all и действительно, заработало.

Спасибо большое!

П.С. Было бы неплохо добавить это в документацию.

  • 2 years later...
Posted (edited)

Доброго времени суток, а как разрешить использовать команду show mac-address-table address / show mac-address-table | include ?

privilege exec level 5  show mac-address-table address 

Illegal command :show mac-address-table address

Edited by Do_omsDay
Posted (edited)

username user privilege 5 password 0 passw0rd
privilege exec level 15 all
privilege config level 15 all
privilege vlan level 15 all
privilege interface-ether level 15 all
privilege exec level 5  configure
privilege config level 5  interface ethernet IFNAME
privilege interface-ether level 5  shutdown
privilege interface-ether level 5  no shutdown
privilege exec level 5  show version
privilege exec level 5  show running-config interface ethernet IFNAME
privilege exec level 5  show mac-address-table interface ethernet IFNAME
privilege exec level 5  show mac-address-table vlan 1
privilege exec level 5  show interface ethernet IFNAME
privilege exec level 5  show interface ethernet status
privilege exec level 5  show interface ethernet counter rate
privilege exec level 5  show interface ethernet counter packet
privilege exec level 5  virtual-cable-test interface ethernet IFNAME

SNR-S2982G-24T-POE-E Device, Compiled on Jul 22 10:28:29 2024
  SoftWare Version V702R101C008B025
  BootRom Version 7.2.59
  HardWare Version 1.0.2

 

настройки взяты с nag.wiki

Edited by Do_omsDay
Posted

@Do_omsDay, если хотите, через include, то это работает и при такой простой настройке: "privilege exec level 5  show mac-address-table".

 

SNR-S2985G-24T>sh ?
  interface          Select an interface to configure
  mac-address-table  Mac address table commands
  running-config     Current Operating configuration
  version            System hardware and software status

SNR-S2985G-24T>sh mac-address-table ?
  |  Output modifiers
  <cr>

SNR-S2985G-24T>sh mac-address-table | i CPU
1    f8-f0-82-78-bc-62           STATIC  System   CPU

 

 

Можно настроить и с возможностью добавления опции:

"privilege exec level 5  show mac-address-table address ff-ff-ff-ff-ff-ff"

Просто нужно не только параметр address указать, но и сам мак-адрес, то есть грубо говоря, полностью дописать команду. В качестве параметра можно использовать любой мак-адрес, не только ff-ff-ff-ff-ff-ff, это распространится на все маки.

 

SNR-S2985G-24T>sh ?
  interface          Select an interface to configure
  mac-address-table  Mac address table commands
  running-config     Current Operating configuration
  version            System hardware and software status

SNR-S2985G-24T>sh mac-address-table ?
  address  Address setting
  |        Output modifiers
  <cr>

SNR-S2985G-24T>sh mac-address-table address ?
  FF-FF-FF-FF-FF-FF  Mac Address <FF-FF-FF-FF-FF-FF>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.