반응형

alteon 로드밸런서의 SLB 설정 순서는 다음과 같이 진행한다.
step 0. 설정값 준비
step 1. SLB 활성화하기
step 2. Real Server 설정하기 , health check 반복주기설정하기
step 3.Real Server의 그룹 설정하기, Loadbalancing 알고리즘 포함 
step 4. Virtual Server 설정하기
step 5. Service 설정하기
step 6. 설정 저장 및 적용하기
 
[main menu]

(example)
>> l4switch - Main# /
------------------------------------------------------------
[Main Menu]
     info     - Information Menu
     stats    - Statistics Menu
     cfg      - Configuration Menu
     oper     - Operations Command Menu
     boot     - Boot Options Menu
     maint    - Maintenance Menu
     diff     - Show pending config changes  [global command]
     apply    - Apply pending config changes [global command]
     save     - Save updated config to FLASH [global command]
     revert   - Revert pending or applied changes [global command]
     exit     - Exit  [global command, always available]

>> l4switch - Main#

 
[how to Layer 4 config ]

step 0. 설정값 준비


1) real server A의 정보
- number : 21 (임의로 지정한 번호이다. 주로, IP 주소의 일부값을 사용하면 편리하다)
- IP : 10.1.1.21
2) real server B의 정보
- number : 22 (임의로 지정한 번호이다. 주로, IP 주소의 일부값을 사용하면 편리하다)
- IP : 10.1.1.22
3) server Group number 
- number : 20 (관리를 위해 임의로 지정한 번호이다)
4) virtual server 정보 
- number : 20 (관리를 위해 임의로 지정한 번호이다. Group number와 같은 번호를 사용하면 편리하다)
- ip : 10.1.1.20


step 1. SLB 활성화하기


설정명령
# /cfg/slb/on

Current status: OFF
New status: ON

상태 확인
# /cfg/slb/cur

Current Layer 4 settings:
ON,   direct enabled, matrix enabled, vma sport disabled, grace disabled clrbkp disabled
...


step 2. Real Server 설정하기, health check 반복 주기 설정하기


설정명령(1) Real Server 설정하기
# /cfg/slb/real 21/ena/rip 10.1.1.21

Current status: disabled
New status:     enabled
Current real server IP address:     0.0.0.0
New pending real server IP address: 10.1.1.21


# /cfg/slb/real 22/ena/rip 10.1.1.22

Current status: disabled
New status:     enabled
Current real server IP address:     0.0.0.0
New pending real server IP address: 10.1.1.22
 
 
설정명령(2) health check 반복 주기 설정하기
사용할 메뉴
inter    - Set interval between health checks
retry    - Set number of failed attempts to declare server DOWN
restr    - Set number of successful attempts to declare server UP

# /cfg/slb/real 21/inter 2   (측정 주기를 2초로 설정)

Current interval:     2
New pending interval: 2

# /cfg/slb/real 351/retry 3  (측정 실패시 재시도 반복 횟수를 3회로 설정)

Current number of failure retries:     4
New pending number of failure retries: 3


# /cfg/slb/real 351/restr 2  (측정 실패 후 측정 성공 2회 확인되면 정상 상태로 표시하는 설정)

Current number of successful attempts:     2
New pending number of successful attempts: 2


step 3.Real Server의 그룹 설정하기, Loadbalancing 알고리즘 포함 


설정명령
# /cfg/slb/group 20/add 21/met hash  (그룹 20번에 21번 서버를 포함시키고, LB 알고리즘은 hash를 선택) 

Real server 21 added to real server group 20.
Current metric:         leastconns
New pending metric:     hash

# /cfg/slb/group 20/add 22/met hash  (그룹 20번에 22번 서버를 포함시키고, LB 알고리즘은 hash를 선택) 

Real server 22 added to real server group 20.
Current metric:         leastconns
New pending metric:     hash

 


step 4. Virtual Server 설정하기


설정명령
# /cfg/slb/virt 20/ena

Current status: disabled
New status:     enabled


step 5. Service 설정하기 


설정명령
# /cfg/slb/virt 20/ena/vip 10.1.1.20/service 80 http/group 20

Current status: disabled
New status:     enabled
Current virtual server IP address:     0.0.0.0
New pending virtual server IP address: 10.1.1.20
Current real server group:     1
New pending real server group: 20


step 6. 설정 저장 및 적용하기


설정명령
# /apply
# /save


 
 

반응형
반응형

구형 cisco 장치의 경우 ssh client와 프로토콜 자동 매칭이 안되서 ssh 에러 메시지가 출력되는 경우가 있다.

내 경우의 해결 방법을 남겨본다. 장치의 IP는 192.168.0.100 으로 가정한다.

1) cisco 장치의 ssh 포트 번호를 찾아보자

    기본 ssh port는 22 이지만, 다른 포트번호로 바꿔둔 경우가 있는데, 찾는 방법이다. 

    리눅스의 nc 명령으로 tcp 포트 범위를 조금씩 스캔해본다. 너무 넓은 범위로 스캔하면 해킹 의심을 받거나 보안 장비에서 차단될 수 있으니, 조금씩 번호를 잘라서 시도해본다.

명령: $  nc -z 192.168.0.100 21-25 
결과: Connection to 192.168.0.100 22 port [tcp/ssh] succeeded!

          설명: 192.168.0.100 장치에 대해서 tcp port 21 부터 25까지 응답을 확인한다.

                  nc -z 옵션은 세션을 맺지않고, listen중인 tcp 포트의 응답만을 확인한다.

                  22 port가 확인되었으니 -p22 옵션을 추가하여 시도해본다.

2) ssh 접속 시도, 그리고 no matching key exchange method found 에러 

명령: $ ssh -p22 username@192.168.0.100
결과: Unable to negotiate with 192.168.0.100 port 22: no matching key exchange method found. 
Their offer: diffie-hellman-group1-sha1

          메시지를 살펴보면 해답이 있는데,

          negotiate를 실패했고, 이유는 key exchange method가 매칭되지 않았다는 것,

          그리고, 장치측에서 권하는 방식은 diffie-hellman-group1-sha1 이라고 설명하고 있다. (친절하네~)

 3) ssh 옵션에 key exchange method 추가하여 접속 시도, 그리고 no matching cipher found 에러

           ssh -oKexAlgorithms  옵션을 추가하여 접속 시도해본다

명령: $ ssh -p22 -oKexAlgorithms=+diffie-hellman-group1-sha1 username@192.168.0.100
결과: Unable to negotiate with 192.168.0.100 port 22: no matching cipher found. 
Their offer: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc

        negotiate를 실패했고, 이유는 cipher 값이 매칭되지 않았다.

        그리고, 추천 방식은 aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc 라고 설명하네 (정답을 떠 먹여주네~)

        ssh -c 옵션에 cipher 타입 한가지씩 대입하여 시도해보면 되겠다.

4) 위 옵션에 cipher 옵션을 추가하여 접속 시도, 그리고 성공 

명령: $ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc username@192.168.0.100
결과: The authenticity of host '192.168.0.100' can't be established.
RSA key fingerprint is SHA256:jgyvlRU10DKdo03ku5p5ilL48.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

            메시지에서 "can't be established" 이 부분은 이 클라이언트와 처음 접속한다는 의미라서 에러가 아니다.

            Are you sure you want to continue connecting (yes/no/[fingerprint])?   이 질문은 yes 입력하면 되겠지.

이어지는 메시지
Warning: Permanently added '192.168.0.100' (RSA) to the list of known hosts.
(username@192.168.0.100) Password: "password를 입력한다"
 
"WARNING: Unauthorized access to this system is
forbidden and will be prosecuted by law.
By accessing this system, you agree that
your actions may be monitored
if unauthorized usage is suspected."

cisco_switch>

접속 성공!!

반응형
반응형

Alteon Application Switch 설정하기 (2) SSH 설정, Telnet 차단, GUI차단 

* 설정 변경 후 apply/save 잊지 말자 
* Alteon Switch 자체의 보안성 강화를 위한 작업
  - telnet 포트 차단 또는 비표준포트로 변경
  - ssh 표준포트를 비표준포트로 변경하고 sshd 사용 
  - web GUI (http, https) 차단 또는 비표준포트로 변경
  
[hostname설정]
 명령 >> /cfg/sys/hprompt ena
     >> /c/sys/ssnmp
        name "my_loadbalancer"

[SSH 설정]
 - ssh 포트 변경 (22 to 2233)
   명령 >> /cfg/sys/access/sshd/sshport
Current SSH server port: 22
Enter new SSH server port [1-65535]: 2233
New SSH server port: 2233 
 - ssh version 1 을 version 3로 변경
   명령 >> /c/sys/sshd/sshv1 dis

 - enable SSH  : >> /cfg/sys/access/sshd/on 
 - disable SSH : >> /cfg/sys/access/sshd/off 


[Telnet 활성화, 비활성화]
  * OS version 9.0에서 default disable 상태임
 - disable telnet : >> /cfg/sys/tnet dis 
 - enable telnet : >> /cfg/sys/tnet ena
 - change telnet port : >> /cfg/sys/access/tnport
       >> apply/save 
 
 
[GUI http/https 차단]
   명령 >> /cfg/sys/access/http dis
   명령 >> /cfg/sys/access/https dis
   

반응형
반응형

[설정 초기화 작업]

- 최초 설정시 기존 config 및 software를 초기화한다 
 명령: /boot/conf/reset
 후속 옵션 : factory
 후속 옵션 : y
 결과확인 : 리부팅 메시지에서 Software version 확인
        리부팅 완료 후 /cfg/dump 실행하여 config가 모두 삭제되었는지 확인 

 
 작업예시

>> Main# /boot/conf factory/reset
Currently set to use active config block on next boot.
Specify new block to use ["active"/"backup"/"factory"]:  factory
Next boot will use factory default config block instead of active.

Reset will use software "image1" and the factory default config block.
>> Note that this will RESTART the Spanning Tree,
>> which will likely cause an interruption in network service.
Confirm reset [y/n]: y
Resetting at 11:04:22 Mon Apr 10, 2023...

**** System Reset from boot cli ****
INIT: Sending processes the TERM signal
...
Restarting system.
... 
Software Version 27.0.5.0 (FLASH image1), factory default configuration.
...
 

설정 확인
>> Main# /cfg/dump
script start "Alteon Application Switch 4408" 4  /**** DO NOT EDIT THIS LINE!
/* Configuration dump taken 11:07:30 Mon Apr 10, 2023
/* Configuration last applied at 17:44:38 Wed Mar 13, 2019
/* Configuration last save at 17:44:45 Wed Mar 13, 2019
/* Version 27.0.5,  Base MAC address 00:03:b2:9e:a0:40
/
script end  /**** DO NOT EDIT THIS LINE!

>> Configuration#


[관리용 IP 설정]

 - IP Interface 1 에 기본 관리 IP를 설정한다
   새로 설정한 interface는 enable 해준다 

준비한 정보 :
   ip address 192.168.0.165, subnet mask : 255.255.255.224
   broadcast ip : 192.168.0.191, gateway ip : 192.168.0.161
 
명령 : >> /c/ip/if 1
          addr 192.168.0.165
  mask 255.255.255.224
  broad 192.168.0.191
  ena
 
명령 : >> /c/ip/gw 1
          addr 192.168.0.161
  ena 


설정 확인 후 설정 저장
 명령 : >> diff 
        - 기존 config와 변경한 config를 보여준다
 명령 : >> apply/save 
        - 새 config를 확정하고, 저장한다 

  작업예시
 
>> Configuration# /c/ip/if 1
------------------------------------------------------------
[IP Interface 1 Menu]
     ip6nd    - IP6 Neighbor Discovery Menu
     ipver    - Set IP version
     addr     - Set IP address
     mask     - Set subnet mask/prefix len
     vlan     - Set VLAN number
     relay    - Enable/disable BOOTP relay
     ena      - Enable IP interface
     dis      - Disable IP interface
     del      - Delete IP interface
     cur      - Display current interface configuration

>> IP Interface 1# addr 192.168.0.165
Current IP address:     0.0.0.0
New pending IP address: 192.168.0.165
Pending new subnet mask:        255.255.0.0

>> IP Interface 1# mask 255.255.255.224
Current subnet mask:     0.0.0.0
New pending subnet mask: 255.255.255.224

>> IP Interface 1# broad 192.168.0.191

>> IP Interface 1# ena
Current status: disabled
New status:     enabled
 

>> Configuration# /c/ip/gw 1
------------------------------------------------------------
[Default gateway 1 Menu]
     ipver    - Set IP version
     addr     - Set IP address
     intr     - Set interval between ping attempts
     retry    - Set number of failed attempts to declare gateway DOWN
     vlan     - Set VLAN number
     prio     - Set priority of default gateway route
     arp      - Enable/disable ARP only health checks
     ena      - Enable default gateway
     dis      - Disable default gateway
     del      - Delete default gateway
     cur      - Display current default gateway configuration

>> Default gateway 1# addr 192.168.0.161
Current IP address:     0.0.0.0
New pending IP address: 192.168.0.161

>> Default gateway 1# ena
Current status: disabled
New status:     enabled

>> Default gateway 1# apply/save
------------------------------------------------------------------
Apply complete; don't forget to 'save' updated configuration.
Request will first copy the FLASH "active" config to "backup",
 then overlay FLASH "active" with new config.
Confirm saving to FLASH [y/n]: y
New config successfully saved to FLASH.

>> Default gateway 1#

결과확인 
>> Default gateway 1# /c/dump
script start "Alteon Application Switch 4408" 4  /**** DO NOT EDIT THIS LINE!
/* Configuration dump taken 11:14:31 Mon Apr 10, 2023
/* Configuration last applied at 11:14:03 Mon Apr 10, 2023
/* Configuration last save at 11:14:05 Mon Apr 10, 2023
/* Version 27.0.5,  Base MAC address 00:03:b2:9e:a0:40
/c/l3/if 1
        ena
        ipver v4
        addr 192.168.0.165
        mask 255.255.255.224
        broad 192.168.0.191
/c/l3/gw 1
        ena
        ipver v4
        addr 192.168.0.161
/
script end  /**** DO NOT EDIT THIS LINE!

>> Configuration#

반응형
반응형
반응형

+ Recent posts