Web and Unmanaged
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable ports from CLI interface on 24 port 1920G Switch

Robymos
Occasional Visitor

Disable ports from CLI interface on 24 port 1920G Switch

Hi everyone from Italy !

I'm trying to disable the port state of some of my 24 ports 1920G switch, but I don't find the commands that can do it from CLI interface. Obviously I see how to do it from web interface, but I have to do this function from CLI interface because I'd like to enable, for example, port 1 from a batch file that will be executed prior a backup job on a NAS connected to that port and then, when backup is ended correctly, execute another batch file to disable the same port 1, to automate the connection/disconnection of the NAS and prevent in this way any issue and danger from virus like cryptolocker & C.

I see there is a "_cmdline-mode on" mode for enabling many others command from CLI interface, but I still haven't found what I'm looking for (thank you U2)

Can anyone help me ?

Thank you in advance for the attention !

Robymos

1 REPLY
Dunky
Regular Advisor

Re: Disable ports from CLI interface on 24 port 1920G Switch

Hi Robymos,

Here's how to enable/disable ports using the 1920 CLI...

 

******************************************************************************
* Copyright (c) 2010-2015 Hewlett-Packard Development Company, L.P. *
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************


Login authentication


Username:admin
Password:
<SWITCH-00>_cmdline-mode on
All commands can be displayed and executed. Continue? [Y/N]y
Please input password:**********************   (password is Jinhua1920unauthorized)
Warning: Now you enter an all-command mode for developer's testing, some command s may affect operation by wrong use, please carefully use it with our engineer's direction.

 

<SWITCH-00>sys  (This enables the configuration commnands, but like 'enable' on cisco)
System View: return to User View with Ctrl+Z.

 

[SWITCH-00]int g1/0/2
[SWITCH-00-GigabitEthernet1/0/2]shutdown

[SWITCH-00-GigabitEthernet1/0/2]save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait............
The configuration file flash:/startup.cfg will be automatically backed up as flash:/_startup_bak.cfg for a future version downgrading.
Active main board:...
Backup done.
All backups completed.....
The current configuration is saved to the active main board successfully.
Configuration is saved to device successfully.

 

To 'enable' a port, the command is 'undo shutdown' ('undo' is the equivalent of prefixing a command with 'no' on cisco)

 

Hope that helps,
Steve