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
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
이번에 AWS 클라우드 운영 업무를 맡아 취업하게 된 걸 축하해. 앞으로 학교 학원에서 배운 것 이상의 다양한 환경을 마주하게 될테니 AWS Document와 더더욱 친하게 지내길 바래. 그렇다고 AWS Document 만 너무 맹신하지 말길 바래. AWS는 기능 변경이 자주 있어서 Document가 바뀐 기능을 따라가지 못하는 경우가 많아. Document에서 본 화면과 실제 접속한 Console의 메뉴 배치나 기능이 약간씩 다른 경우가 아주 많으니까 놀라지 말고, 필요한 기능은 꼭 테스트를 해본 뒤에 사용하는 것을 추천한다.
이제 회사에서 사용하는 여러개의 AWS Account의 운영 업무를 맡게 됬으니, 여러 Account의 Console을 로그인 로그아웃하면서 환경을 바꿔가면서 일을 하는게 여간 번거로운게 아닐거야. 만일, AWS Account가 두세개 정도라면 몇가지 웹브라우저(크롬, 파이어폭스, 아파치, 엣지 등)을 동시에 열어놓고, 각각 다른 Account의 Console을 로그인해두고 사용하면 되겠지. 하지만, Account 갯수가 그 보다 더 많다면 그렇게 작업하긴 곤란하겠지. 회사에 프로젝트는 여러개인데 AWS 운영자는 그보다 수가 적은게 보통이니까, 운영자 한명당 맡게 되는 AWS Account가 십여개씩 되는 건 일반적인 상황일걸. 그런 환경에서 이쪽 저쪽 Account를 옮겨다니면서 작업하는 불편을 덜어줄 수 있는 AWS 의 Switch Role을 소개해볼게.
SwitchRole의 기본개념은 Gateway 개념과 유사해. 먼저, 내가 주로 사용할 AWS Account를 하나를 정해야되. 일명 Gateway Acoount라고 부를게. 그리고, 관리해야할 여러개의 AWS Account들에서 위의 Gateway Account의 Console Access 권한을 허용해주는거야. 그러면, Gateway Account에만 로그인한 상태로 SwitchRole 기능을 이용해서 별도의 로그인 없이 한번의 클릭만으로 다른 AWS Account의 Console을 접속할 수 있어.
그러면, SwitchRole을 사용하기 위한 환경 설정을 해볼게.
우선, 테스트할 환경을 소개하지. AWS Account 두개 또는 세개를 준비해. AWS Account ID는 12자리 숫자로 되어있지. 여기선 별칭으로 A, B, C라고 할게. - AWS Account ID "A" (1111 1111 1111) - AWS Account ID "B" (2222 2222 2222) - AWS Account ID "C" (3333 3333 3333)
SwitchRole Test Diagram
위 ID 중에서 Account A를 Gateway 역할로 사용할게. 그리고, 관리할 대상은 Account B와 C라고 할게.
그럼 이제부터 설정을 시작할거야.
Chapter 1. AWS Account "A" 콘솔에서 설정할 내용
1.1) create an IAM user
웹브라우저(예:크롬)에서 AWS Account ID "A"로 AWS Management Console에 로그인한다. IAM 메뉴에서 AWS Switch Role (역할전환)에 사용할 IAM user 를 원하는 이름으로 만든다.
내 경우에는 IAM user 를'maestro'라는 이름으로 만들었다. root Account를 그대로 이용할 수도 있겠지만, user별 역할 분리와 보안성 강화를 위해서는 SwitchRole에 사용할 IAM user 를 이용하고, 콘솔 로그인 옵션에 MFA(멀티 팩터 인증)을 추가할 것을 권장한다. 물론, 기존에 사용하던 IAM user가 있다면 그대로 이용해도 관계는 없다.
create a IAM user ' maestro'
IAM user 만드는 방법과 MFA 설정하는 방법은 다른 문서를 참고하길 바란다. 이제 Account A 콘솔에서는 더 이상 설정할 것이 없다.
Chapter 2. AWS Account "B"콘솔에서 설정할 내용
2.1) create a role for allow IAM user 'maestro' of Account "A"
이번 작업은 다른 웹브라우저(예:파이어폭스)를 이용하는게 편할 것이다. Account ID B의 AWS Management Console에 접속할 Account ID A의 maestro user를 위한 권한을 허용하는 Role을 설정을 하자.
Account ID B의 AWS Management Console에 로그인하고, IAM 메뉴에서 아래와 깉이 역할(Role)을 하나 만든다.
Create Role
--------------------------------------------------------------------------------------------------------------------------------- Role Name : switchrole-maestro-of-A-to-B
Step 1. Select trusted entity - Trusted entity type : select "AWS account" - An AWS account > select "Another AWS account" > Account id [ 111111111111 ] <-- 여기엔 AWS Account A의 ID 번호 12자리 숫자를 입력해. > Options : select "Require MFA"
step 1.Select trusted entity
Step 2. Add permissions - Permissions policies . select "AdministratorAccess" 여기에서는 maestro user에게 허용할 권한을 필요한 만큼 설정해주면 된다. 이 예제에서는 쉬운 설명을 위해 full access 권한인 AdministratorAccess를 선택하였는데, 실제 적용할 때는 user가 하는 일과 역할에 맞게 권한을 나눠서 주는것을 검토해보길 바래.
Step 2. Add permissions
Step 3. Name, review, and create
처음 계획했던 Role name을 입력하고, 필요한 tag를 추가하고, [Create role] 버튼을 클릭하여 작업을 완료한다. 이 단계에서는 Trust policy를 수정하지 말고, 이후에 policy를 완성한 후 필요한 부분을 수정하는 것을 추천한다.
위 1)과 같이 역할(Role)을 만든 후 신뢰관계(Trust relationships) 의 JSON 코드를 보면 root 계정을 기준으로 설정이 되어있다. 처음 계획했던 대로 AWS Account "A"의 'maestro' user에게만 권한을 주기 위해 신뢰할 수 있는 엔터티(Trusted entities)의 Principal 부분의 내용을 이렇게 수정한다.
* AWS Account ID "C"의 콘솔에서도 이 chapter 2의 내용과 동일하게 설정해주면 되므로, AWS Account ID "C"의 콘솔에서 설정할 내용은 생략한다.
Chapter 3. switchrole 링크 만들기
이제, AWS Management Console에 Account ID A의 maestro user로 로그인했을 때, Account ID B와 C의 콘솔로 연결되는 switchrole 링크를 만들어야 한다.
3.1) Account ID A의 maestro user에서 역할전환(SwitchRole) 정보 등록하기
AWS Management Console에 Account ID A의 maestro user로 로그인하고, Console 우측 상단의 "maestro" id를 클릭하면 역할전환(SwitchRole) 버튼이 보일것이다.
Account A의 IAM user인 maestro 로그인하기
역할전환(SwitchRole) 버튼을 클릭하고, Account B 와 C에서 설정했던 Role 정보를 등록해주면 된다.
역할전환(Switch Role) 버튼
a. Account B(222222222222)에 만들었던 Role 정보를 등록한다 [Switch Role] Account ID : 222222222222 IAM role name : switchrole-maestro-of-A-to-B Display name (optional) : maestro-of-A-to-B Display color (optional) : Red 내용 입력하고 [Switch Role] 버튼을 클릭한다.
maestro user에서, B에 대한 Switch Role 정보를 등록하기
b. Account C(333333333333)에 만들었던 Role 정보를 등록한다 [Switch Role] Account ID : 333333333333 IAM role name : switchrole-maestro-of-A-to-C Display name (optional) : maestro-of-A-to-C Display color (optional) : Orange 내용 입력하고 [Switch Role] 버튼을 클릭한다.
maestro user에서 , C에 대한 Switch Role 정보를 등록하기
3.2) 역할전환(SwitchRole) 링크를 클릭하여 다른 계정의 콘솔에 접속하기
이제, WS Management Console에 Account ID A의 maestro user로 로그인하고, Console 우측 상단의 "maestro" id를 클릭하면 역할전환(SwitchRole) 버튼 위쪽에 B와 C로 이동하는 링크가 보일 것이다.
maestro user화면에 보여지는 B와 C로 연결하는 switchrole 링크들
[maestro-of-A-to-B] 링크를 클릭하면 Account B의 Console로 접속이 된다.
Accout B의 console로 전환된 화면, 상단에 Display Name에 작성한 ...B... 가 표시된다
ID를 클릭하면 [다시 전환] 이라는 버튼이 표시되며, 이것은 Account ID A의 maestro 의 Console로 다시 돌아갈 때 사용하는 링크이다.
Account B로 switch된 상태에서 maestro로 다시전환하는 링크가 보인다
정리하면,
이제부터는 새로운 AWS 클라우드 계정을 만들 때마다 위와 같이 역할전환 설정을 해두면 되고, 클라우드 운영업무를 할 때는, Account ID A의 maestro user로 콘솔 로그인한 뒤, 관리할 계정으로 역할전환하면 된다.
회사 외부의 고객, 협력사 등에 공지메일을 보내야할 때가 있는데, 내 계정이 아닌 팀 또는 회사대표성격을 띄는 메일 계정을 이용해서 메일을 보내야할 경우가 있다.
이 때, 공지메일을 보내는 발신전용의 기능만을 위해서, 유료 사용자 계정을 만들어서 메일을 보내면 되지만, 회신오는 메일을 확인하는게 번거로웠다. 그리고, 가끔 사용하는 기능을 위해서 유료 계정 한개 요금을 유지해야하는 것도 아깝기도 해서 다른 방법이 없는지 찾아보았다.
그룹메일은, 주로 부서 또는 프로젝트 단위로 단체로 메일을 받기 편하도록 만들어진 기능이고, 그룹메일은 무료라서 편리하게 많이 사용하는 기능이다. 이 그룹메일 ID를 활용해서 메일 발신을 할 수 있으면 좋지 않을까하여 Google Workspace 자료를 찾아보았지만, 그룹메일에서 메일 발신하는 설명은 찾을 수가 없었다. 셀프로 삽질을 해보기로하고, 그룹메일의 설정 기능을 살펴보면서 이것저것 테스트해보니 그룹메일에서 메일을 발송하는 방법이 있었다.
테스트한 내용은 아래와 같다.
1. 구글웍스 관리자에서, 메일 발송에 사용할 그룹메일 이름을 partner_noreply@mycompany.com 으로 생성했고, 내 계정을 이 그룹메일의 관리자로 등록했다. (그룹메일 등록 방법은 생략)
2. 내 계정으로 구글메일 로그인 후 '그룹스' 메뉴에서 이 그룹메일의 '그룹설정' 화면을 찾아 들어간다. 첨부 그림 (1) ~(5)까지 참고.
3. '그룹을 대표하여 게시할 수 있는 사용자' 항목에서 '그룹관리자'와 '그룹회원'까지 권한을 부여하고, '기본발신자'를 '그룹주소'로 설정하고 저장한다. 첨부그림 (6)~(8) 참고.
구형 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."
* 설정 변경 후 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
- 최초 설정시 기존 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!