cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
591
Views
1
Helpful
2
Replies

Automating Interface Change

bakerjw
Level 1
Level 1

Good day, all. I am still pretty much a Cisco rookie and am trying to automate a task. I've been looking at Powershell, Plink and other options.

We have a series of Cisco CBS350 switches trunked together with a primary switch acting as a layer 3 router. We keep our network environment isolated from our main corporate networks; however, we have occasional instances where one of our users needs to have access to one of our test subnets. When they have access, they are creating a bridge situation which we can allow but need to limit how long they can be connected.

The solution that I need to come up with is when the user triggers the process, an automated script or similar will log on to the switch using ssh or similar, and execute these commands to configure their connect port to use an active VLAN.
configure
interface GE 14
switchport access vlan 102

After 2 hours, the process will then execute these commands to configure their port to a dead VLAN.

configure
interface GE 14
switchport access vlan 4000

I script a lot with Powershell and am leaning toward user authentication with a public key but I am certain that the community knows of options that I have not found yet.

Insights are greatly appreciated.

1 Accepted Solution

Accepted Solutions

balaji.bandi
Hall of Fame
Hall of Fame

are you limited to Powershell - suggest to use Python runs in window environment to use this script

let me know we can offer small script to make this changes on fly  -

Do you have Certificate installed on switch ?

some example script help for you to connect cisco devices (i am sure that should work on CBS also)

https://www.powershellgallery.com/packages/Invoke-CiscoCommand/1.1/Content/Invoke-CiscoCommand.ps1

https://ipbalance.com/program-language/ms-powershell/powershell-script-to-save-cisco-configuration-by-ssh/

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

are you limited to Powershell - suggest to use Python runs in window environment to use this script

let me know we can offer small script to make this changes on fly  -

Do you have Certificate installed on switch ?

some example script help for you to connect cisco devices (i am sure that should work on CBS also)

https://www.powershellgallery.com/packages/Invoke-CiscoCommand/1.1/Content/Invoke-CiscoCommand.ps1

https://ipbalance.com/program-language/ms-powershell/powershell-script-to-save-cisco-configuration-by-ssh/

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

bakerjw
Level 1
Level 1

Many thanks as those are very helpful links and can integrate into our process quite easily.