首先确认交换机是否支持smart install服务
检查命令如下:
switch#show vstack config | inc Role 
Role:Client (SmartInstall enabled) 
或 
switch#show vstack config | inc Role 
Role:Director (SmartInstall enabled)
1、如果支持smart install 可通过no vstack关闭smart install 
switch(config)#no vstack
switch#show vstack config 
Role: Client (SmartInstall disabled)
或
switch#show vstack config  
Role: Director (SmartInstall disabled)
关闭了smart install之后tcp 4786端口也会关闭。
通过show tcp brief all 查看交换机当前监听的tcp端口。
| 1 2 3 4 5 6 7 | 
switch#show tcp brief all
 TCB Local Address Foreign Address (state)
 05FD9F98 0.0.0.0.4786*.* LISTEN
 0568FFFC 0.0.0.0.443*.* LISTEN
 0568F038 0.0.0.0.443*.* LISTEN
 0568E428 0.0.0.0.80*.* LISTEN
 0568D818 0.0.0.0.80*.* LISTEN
 | 
2、 如果设备不支持no vstack ,且在show tcp brief all 中有tcp 4786端口,那么可以通过acl限制端口的访问。
例如:
| 1 2 3 4 5 | 
ip access-list extended DropTCP4786
  deny tcp any any eq 4786
  permit ip any any 
 interfaceGigabitEthernet0/0
  ip access-group DropTCP4786 in
 |