實驗拓撲及描述
在上圖所示的拓撲中,Cloud1與交換機LSW1直連,我們將Cloud1規劃在VLAN100內,同時也為交換機在VLAN100的虛擬接口規劃了IP地址192.168.35.101/24。其中Cloud1添加的是虛擬機的虛擬網卡。
實驗需求
完成交換機的配置,使得物理機能夠通過SSH的方式登錄到該交換機。
實現步驟及配置
cloud的配置如下:
SW1的配置如下:
創建VLAN100:
[SW1] vlan 100
[SW1-vlan100] quit
配置接口GE0/0/1:
[SW1] interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1] port link-type access
[SW1-GigabitEthernet0/0/1] port default vlan 100
為交換機的Vlanif100配置IP地址:
[SW1] interface Vlanif 100
[SW1-Vlanif100] ip address 192.168.35.101 24
配置用於SSH登錄的用戶名(sshuser)、密碼(huawei123):
[SW1] aaa
[SW1-aaa] local-user client001 password cipher Huawei123
[SW1-aaa] local-user client001 privilege level 3
[SW1-aaa] local-user client001 service-type ssh
[SW1-aaa] quit
在交換機上生成本地密鑰對:
[SW1] rsa local-key-pair create
The key name will be: SW_Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
it will take a few minutes.
Input the bits in the modulus[default = 512]:
Generating keys...
...++++++++++++
.++++++++++++
..................++++++++
......++++++++
激活Stelnet服務:
[SW] stelnet server enable
[SW] ssh authentication-type default password
[SW] ssh user client001 authentication-type password
[SW] ssh user client001 service-type all
配置VTY(虛擬終端)界面,身份認證方式為AAA認證,允許用戶以SSH的方式接入:
[SW] user-interface vty 0 4
[SW-ui-vty0-4] authentication-mode aaa
[SW-ui-vty0-4] protocol inbound ssh
這樣就完成了ssh遠程登錄交換機啦,是不是很簡單呢,看完還不懂的小夥伴們可以觀看 。
閱讀更多 攻城獅成長日記 的文章