一、Stackwise Virtual模式
單台SW默認的模式是standalone模式,如果需要將SW配置為stackwise virtual模式,必須進行配置。
1、交換機標識(Switch identity)
stackwise virtual domain中的每個交換機會被分配一個唯一的switch identity標識,該標識用作接口的命名的第一部分(例如FortyG1/0/10)。
2、轉換模式
在配置將單獨的交換機轉換為Stackwise virtual之前,需要將SVL提前連接,以最大程度的減少SW的重啟次數。如下所示,可以看到Switch1和Switch2屬於stackwise virtual domain100,他們使用的是40G接口作為SVL。

配置步驟:
①配置stackwise virtual domain
兩台交換機都配置同樣的domian id,這里是100
SV-1#conf t Enter configuration commands, one per line. End with CNTL/Z. SV-1(config)#stackwise-virtual Please reload the switch for StackWise Virtual configuration to take effect SV-1(config-stackwise-virtual)#domain 100
SV-2#conf t Enter configuration commands, one per line. End with CNTL/Z. SV-2(config)#stackwise-virtual Please reload the switch for StackWise Virtual configuration to take effect SV-2(config-stackwise-virtual)#domain 100
②配置SVL
默認情況下,在standalone模式下,除非明確更改為其他switch number,否則switch將用switch1標識。 在轉換為StackWise Virtual的過程中,switch number會自動更改,以反映StackWise Virtual域中的兩個交換機關系。
SV-1#conf t Enter configuration commands, one per line. End with CNTL/Z. SV-1(config)#interface range fortyGigabitEthernet 1/0/23-24 SV-1(config-if-range)#stackwise-virtual link 1 WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/23 on reboot WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/24 on reboot SV-1(config-if-range)#end
SV-2#conf t Enter configuration commands, one per line. End with CNTL/Z. SV-2(config)#interface range fortyGigabitEthernet 1/0/23-24 SV-2(config-if-range)#stackwise-virtual link 1 WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/23 on reboot WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/24 on reboot SV-2(config-if-range)#end
在range的端口內執行“ stackwise-virtual link”命令后,交換機將自動捆綁這些鏈路以形成Port-channel。 無需再手動配置Port-channel或指定協議。交換機將自動創建具有內部協議的Port-channel。
③配置雙活檢測(dual-active detection)
該配置需要配置在非SVL接口上
SV-1(config)#interface fortyGigabitEthernet 1/0/12 SV-1(config-if)#stackwise-virtual dual-active-detection WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/12 on reboot. SV-1(config-if)#end
SV-2(config)#interface fortyGigabitEthernet 1/0/12 SV-2(config-if)#stackwise-virtual dual-active-detection WARNING: All the extraneous configurations will be removed for FortyGigabitEthernet1/0/12 on reboot. SV-1(config-if)#end
④保存配置並重啟交換機
該步驟將standalone模式的SW轉換到stackwise virtual domain
SV-1#wr mem Building configuration... [OK] SV-1#reload Reload command is being issued on Active unit, this will reload the whole stack Proceed with reload? [confirm] # Hit Enter here to proceed with the reload
SV-2#wr mem Building configuration... [OK] SV-2#reload
Reload command is being issued on Active unit, this will reload the whole stack Proceed with reload? [confirm] # Hit Enter here to proceed with the reload
在交換機重啟期間,基於交換機Active角色和standby角色的選舉,startup配置和running配置將同步,且將為第一個啟動的SW或是Active Virtual SW分配switch identity為1,第二個啟動或Secondary Virtual SW分配switch identity為2,這從SW的接口標識也能看到。
*Mar 1 23:58:27.791: %IOSXE_REDUNDANCY-6-PEER: Active detected switch 2 as standby. *Mar 1 23:58:27.790: %STACKMGR-6-STANDBY_ELECTED: Switch 1 R0/0: stack_mgr: Switch 2 has been elected STANDBY. *Mar 1 23:58:47.829: %REDUNDANCY-5-PEER_MONITOR_EVENT: Active detected a standby insertion (raw-event=PEER_FOUND(4)) *Mar 1 23:58:47.829: %REDUNDANCY-5-PEER_MONITOR_EVENT: Active detected a standby insertion (raw-event=PEER_REDUNDANCY_STATE_CHANGE(5)) *Mar 1 23:59:22.369: %HA_CONFIG_SYNC-6-BULK_CFGSYNC_SUCCEED: Bulk Sync succeeded *Mar 1 23:59:23.371: %RF-5-RF_TERMINAL_STATE: Terminal state reached for (SSO)
當完成之后,可能就會注意到不管是console還是management接入任何一台SW,都是一台邏輯的SW(呈現的關鍵是Active那台SW)
SV-1#show switch Switch/Stack Mac Address : 00a3.d145.2300 - Local Mac Address Mac persistency wait time: Indefinite H/W Current Switch# Role Mac Address Priority Version State ------------------------------------------------------------------------------------- *1 Active 00a3.d145.2300 15 V01 Ready 2 Standby 00a3.d145.1e00 14 V01 Read
通過show switch命令可以看到兩台SW作為一個邏輯的SW在運行。
