■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
● NXOS
ssh enable (default) 상태로 ssh 관련 별도 설정 없음.
다른 SW ---> NXOS SW SSH 연결이 안될 때
(Nexus 9000에 SSH를 연결할 수 없습니다. "일치하는 암호를 찾을 수 없음" 오류 수신)
: 약한 암호(~cbc)가 비활성화되었기 때문 ---> ~cbc 암호 추가
switch(config)# run bash sudo grep -i cipher /isan/etc/dcos_sshd_config
#secure ciphers and MACs
#CSCun41202 : Disable weaker Ciphers and MACs
Ciphers aes128-ctr,aes256-ctr
feature bash-shell
ssh cipher-mode weak --- 약한 암호인 aes128-cbc,aes192-cbc,aes256-cbc를 허용
switch(config)# run bash sudo grep -i cipher /isan/etc/dcos_sshd_config
#secure ciphers and MACs
#CSCun41202 : Disable weaker Ciphers and MACs
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc
show ssh server
show users
ssh pray@1.1.12.2
■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
● IOS
enable password anne
username pray password anne
SSH Key 생성
방법 1. crypto key generate rsa general-keys label RSAKEY
방법 2-1. ip domain-name innern
2-2. crypto key generate rsa
ip ssh version 2
line vty 0 4
login local
transport input ssh
access-class [acl name] in vrf-also (별도의 VRF 생성하여 사용 시)
------------------------------------------------
show ip ssh
show crypto key mypubkey rsa
show users
* ssh 접속 명령어 : ssh -l admin 1.1.1.2
show control-plane host ...
show tcp
※ "bootflash:cat4500es8-universal.SPA.03.10.02.E.152-6.E2.bin" : universal 버전은 SSH를 지원하지 않는다.
SSH를 사용하려면 "bootflash:/cat4500e-universalk9.SPA.03.10.00.E.152-6.E.bin" 버전으로 변경해야 함.
■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
line template vty-config
absolute-timeout 360
access-class ingress vty-acl
session-limit 1
transport input ssh
vty-pool default 0 9 line-template vty-config
ipv4 access-list vty-acl
10 permit ipv4 x.x.x.x/24 any
20 permit ipv4 host x.x.x.x any
interface MgmtEth0/RP0/CPU0/0
description ## mgmt ##
vrf mgmt
ipv4 address 192.168.1.1 255.255.255.0
!
ssh server v2
ssh server vrf mgmt
ssh server session-limit 10
#########################################
ipv4 access-list ssh
10 permit ipv4 1.1.20.0/24 any
interface GigabitEthernet0/0/0/1
vrf ssh
ipv4 address 1.1.20.2 255.255.255.0
ipv4 access-group ssh ingress
==========================
line default
access-class ingress ssh-acl
ipv4 access-list ssh-acl
10 deny ipv4 1.1.12.0/24 any
interface MgmtEth0/0/CPU0/0
vrf v-ssh
ipv4 address 1.1.12.2 255.255.255.0
==========================
line template vty-config
access-class ingress ssh-acl
!
vty-pool default 0 9 line-template template vty-config
ipv4 access-list ssh-acl
10 deny ipv4 1.1.12.0/24 any
!
interface MgmtEth0/0/CPU0/0
vrf v-ssh
ipv4 address 1.1.12.2 255.255.255.0
==========================
control-plane
management-plane
out-of-band
vrf v-ssh
interface MgmtEth0/0/CPU0/0
allow SSH peer
address ipv4 1.1.12.1
address ipv4 1.1.1.0/24
address ipv4 1.1.2.0/24
address ipv4 172.16.10.0/24
#########################################
● IOS-XR
(필수)
crypto key generate rsa
ssh server v2
(선택.1)
line template ssh
exec-timeout 0 0
session-limit 1
access-class ingress ssh-acl
transport input ssh
!
ipv4 access-list ssh-acl
10 deny ipv4 1.1.12.0/24 any
!
ssh server session-limit 1
(선택.2)
control-plane
management-plane
inband
interface all
allow SSH peer
address ipv4 1.1.12.2
address ipv4 192.1.12.2
!
ssh server session-limit 1
#####################################################
● Management Traffic 전용 네트워크를 통해 Node에 접속 하는 경우 추가 설정
vrf mgmt
address-family ipv4 unicast
!
router static
vrf mgmt
address-family ipv4 unicast
0.0.0.0/0 MgmtEth0/RP0/CPU0/0 192.168.10.1
!
interface GigabitEthernet0/0/0/0
vrf mgmt
ipv4 address 1.1.12.2 255.255.255.0
----------------------------------------------------------
설정 확인
show crypto key mypubkey rsa
show ssh session details
show users
* ACL 구성 방법 3가지.
1. telnet vrf default ipv4 server max-servers 5 access-list [ ] ---- telnet 설정 시
2. line template [ssh] 아래에 access-class ingress [ssh-acl]
3. control-plane ----- 제어 및 관리 플레인에 대한 액세스를 제한하여 트래픽이 노드 자체로 향하도록 구성
management-plane
inband
interface all
allow SSH peer
address ipv4 1.1.12.2
address ipv4 192.1.12.2
* 일반 IOS와 달리 IOS-XR은 RSA 키를 생성하기 위해 호스트 이름과 도메인 이름이 필요하지 않음.
* (ios-xr --> ios-xr) ssh 접속 시 username 미 설정 시, 현재 내가 접속되어 있는 계정으로 접속 시도함.
(원격 접속 하고자 하는 장비에 동일한 username이 설정되어 있어야 됨, 그렇지 않을 경우 원격접속 할 장비의 username을 지정해야 함)
* RSA 키 생성 시 name 설정 하는 경우 IOS, IOS-XE와 마찬가지로 명명된 키를 SSH 프로세스에 연결 해야 함.
'A' 카테고리의 다른 글
WORD (0) | 2025.04.02 |
---|---|
[IOS] CISCO Accounting Encrypt Type (0) | 2023.06.01 |