交換機SSH+Telnet的IP設定
1. 設定enable password
記得一定要設並enable的登入密碼,沒有設定,遠端登入後只能在一般權限,無法進入全局模式
switch> enable
switch# configure terminal
switch(config)# enable secret mypassword
switch(config)# exit
switch#
2.1 新增ssh+telnet用的使用者
switch> enable
switch# configure terminal
switch(config)# username admin password cisco
switch(config)# exit
switch#
2.2 設定允許連線
switch#configure terminal
switch(config)#hostname myswitch #修改設備名稱
myswitch(config)#ip domain-name example.com #設定domain
myswitch(config)#crypto key generate rsa #ssh驗證機制
myswitch(config)#ip ssh version 2 #開啟ssh版本2
myswitch(config)#line vty 0 15 #設定連接的線路
myswitch(config-line)#login local #開啟本地驗證
myswitch(config-line)#transport input ssh telnet #設定存取的協定
myswitch(config-line)#exit
myswitch(config)#exit
switch#show ip ssh
3. 設定PC網卡IP+確認管理vlanIP
- PC和網路設備直連,PC上會顯示一張新的ethernet網卡,這張網卡要設定IP
- 設定PC網卡IP要和網路設備的管理port(管理vlan)同網段,
這個PC的網卡IP設定為網路設備的GW,這是給直連2台設備的設定
如果網路架構另外有GW,則PC和網路設備的GW都指向相同的GW
- 這個階段還沒有透過網卡做連線,所以不影響
4. 設定管理vlan IP
- 管理vlan要和PC網卡同網段,要確認可以互ping
switch#configure terminal
switch(config)#interface vlan 1
switch(config-if)#ip address 192.168.8.253 255.255.255.0
switch(config-if)#no shutdown
switch(config-if)#exit
switch(config)#ip default-gateway 192.168.8.101
switch(config)#exit
switch#show interface vlan 1
5. 設定網路設備的gateway,這是給整台網路設備的GW
switch(config)#ip default-gateway 192.168.8.101
switch(config)#exit
switch#show interface vlan 1
6. 測試可以互ping
ping 192.168.8.101
7. PC可以透過putty ssh 或者 telnet 連上網路設備了