cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
37400
Views
11
Helpful
6
Replies

How to shut no shut in one command

kelly.abbott
Level 1
Level 1

 

On servers and desktops we do:

C:\ipconfig /release && ipconfig /renew

That way we are able to reconnect after releasing an IP and not thrown out and unable to reconnect because it has no IP.

 

For the Cisco 4506e:

What is the syntax to do a shut, no shut command as one entry so when I'm thrown out, the port goes back to no shut so I can reconnect?

 

3 Accepted Solutions

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

You can't chain commands like that on IOS. The best you can do is launch an EEM script and then have that execute the commands in the background:

!
event manager applet SHUTNOSHUT
event none
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "int gi0/1"
action 4.0 cli command "shut"
action 5.0 cli commnad "no shut"
action 6.0 cli command "quit"
!

Then from the CLI launch it with:

event manager run SHUTNOSHUT

 

cheers,

Seb.

View solution in original post

Hello,

 

you could use the terminal shell to enter multiple commands. Let's say you want to bounce interface GigabitEthernet0/0 (shut/no shut), you would enter the terminal shell and then enter the line below:

 

4506#term shell

4506#conf t; interface GigabitEthernet 0/0; shut; sleep 5; no shut; end

 

 

View solution in original post

Mohsin Alam
Cisco Employee
Cisco Employee

you can do it using EEM and it should give you desired results. 

 


## Make sure to mark post as helpful, If it resolved your issue. ##

 





## Make sure to mark post as helpful, If it resolved your issue. ##

View solution in original post

6 Replies 6

Leo Laohoo
Hall of Fame
Hall of Fame
Depends on the age of the NIC.
I've seen wired clients that have very old NIC that "shut/no shut" does not help and the only way for the NIC to "wake up" is to reboot the entire chassis.

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

You can't chain commands like that on IOS. The best you can do is launch an EEM script and then have that execute the commands in the background:

!
event manager applet SHUTNOSHUT
event none
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "int gi0/1"
action 4.0 cli command "shut"
action 5.0 cli commnad "no shut"
action 6.0 cli command "quit"
!

Then from the CLI launch it with:

event manager run SHUTNOSHUT

 

cheers,

Seb.

how about just copy and paste the commands....

marce1000
VIP
VIP

 

 - Thrown out , depending on what it means, note also that a 'null-time-elapsed' shut/no-shut may not always achieve the desired result.

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Hello,

 

you could use the terminal shell to enter multiple commands. Let's say you want to bounce interface GigabitEthernet0/0 (shut/no shut), you would enter the terminal shell and then enter the line below:

 

4506#term shell

4506#conf t; interface GigabitEthernet 0/0; shut; sleep 5; no shut; end

 

 

Mohsin Alam
Cisco Employee
Cisco Employee

you can do it using EEM and it should give you desired results. 

 


## Make sure to mark post as helpful, If it resolved your issue. ##

 





## Make sure to mark post as helpful, If it resolved your issue. ##
Review Cisco Networking for a $25 gift card