이전에 1.5.3버전으로 작성한 것이 있으나


최신버전의 설정에 변화가 생겨서 새로 설치하는 겸, 한번 정리해서 올려봅니다.


설치가 조금 번거로워서 그렇지, 한 번 하고나면 패킷트레이서는 쳐다보지도 않게 됩니다.


지원되는 명령어가 압도적으로 많은건 당연하고,


실제 망의 장비나 VMware의 가상머신과 붙일 수 있기 때문에 확장성이 비할 바가 못 됩니다.

정말 못할게 없어져요.


단언컨대 GNS3, VMware만 있다면 실습환경 구축 끝입니다.




0. GNS3는 설치되어 있다고 가정합니다.


없으신 분은 아래에서 계정만드시고 로그인 하면 무료로 받을 수 있습니다.


현재 최신버전은 2.1.11이네요.

 

GNS3 다운로드: https://www.gns3.com/software/download


 

1. IOU 이미지 구하기


IOU 이미지라 함은 시스코 스위치의 가상구동용 OS라 생각하시면 됩니다.


IOU는 L2, L3가 있는데 정확하진 않지만 L2가 스위치, L3가 라우터인 듯 합니다.


구글에 "cisco iou image" 로 검색하면..?



2. IOU 키젠 구하기


IOU라는 시뮬이 프리웨어가 아닙니다. 따라서 인증된 키파일이 있어야 사용이 가능합니다.


다행인건 이 키파일을 만드는 것이 매우 쉽다는 거죠.


키젠으로 키값을 알아내고 텍스트파일로 만들어 넣어주면 됩니다.


이 키값이 디바이스마다 상이하므로 GNS3 VM 내에서 알아내야 합니다.


키젠은 파이썬으로 작성되어 있습니다.


처음 IOU를 사용할 때가 파이썬 버전2.7에서 3으로 넘어갈 때라.. 삽질을 했던 기억이 나네요.

 

아래분께 지금도 참 감사합니다.

 

 

 


http://forum.gns3.net/download/file.php?id=2950



3. GNS3 가상머신 파일(*.ova) 다운로드


스위치 운영체제인 CatOS는 IOU방식으로 구동되므로 다이나밉스에서 구동이 불가능합니다.


리눅스기반의 가상머신이 필요합니다.


참고로 GNS3와 GNS3 가상머신의 버전이 서로 일치해야 합니다.


같은 시점에서 다운로드 하신다면 신경쓰실일 없겠지만요.


가상머신의 버전도 2.1.11입니다.


다운받은 zip파일을 풀면 ova파일이 있습니다.


GNS3 가상머신 다운로드: https://www.gns3.com/software/download-vm




4. 가상화 프로그램 설치


GNS3 가상머신을 구동시켜줄 가상화 프로그램을 설치해야합니다.


VMware Workstation Player(비상업용), Oracle VirtualBox는 무료입니다.


VMware Workstation Player 다운로드: https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html


Oracle VirtualBox 다운로드: https://www.virtualbox.org/wiki/Downloads




5. 가상화 프로그램에서 GNS3 가상머신 불러오기


위에서 다운로드한 ova파일을 가상머신으로 만들 차례입니다.


GNS3 VM.ova를 실행해서 가상화 프로그램에 올립니다.

 

부팅이 끝나면 GNS3 VM의 IP주소가 나옵니다.

 

 

 

 

 

 

6. GNS3와 GNS3 VM 연동시키기

 

GNS3가 GNS3 VM을 인식하고, GNS3의 다이나밉스와 VM이 서로 같은 망에 있도록 해야합니다.

 

다이나밉스 서버는 본래 127.0.0.1에 바인딩 되도록 되어있으므로

 

GNS3 VM과 같은 망에 바인딩되도록 설정을 조정해야 합니다.

 

참고로 다이나밉스 서버를 네트워크에 연결된 어댑터에 바인딩하면

 

다른 PC에서도 가상화된 장비의 콘솔에 접근할 수 있게 됩니다.

 

만약 그렇게 한다면 GNS3 VM도 브리지로 구성해서 같은 네트워크에 붙여야 겠죠.

 

GNS3 메뉴의 Edit를 눌러 Preferences를 열고,

 

Server항목의 Host binding을 위 화면에서 본 GNS3 VM와 같은 망의 어댑터를 지정해줍니다.

 

 

 

 

다음 GNS3 VM 항목으로 넘어가서, Enable the GNS VM을 체크하고,

 

Virtualization engine과 VM name을 지정해줍니다.

 

 

 

 

설정이 잘 되면 아래처럼 서버리스트에 GNS3 VM이 추가되고 구동중이라는 것이 보입니다.

 

 

 

 

이렇게 GNS3와 GNS3 VM의 연동은 끝났습니다.

 

 

 

7. IOU키젠 업로드 및 라이센스 파일 만들기

 

앞서 언급했던 것처럼 키젠을 GNS3 VM에서 구동하고 키값을 알아내야 합니다.

 

이전과 바뀐 점이라면 이젠 웹에서 업로드가 아예 불가능합니다. 1.4버전부터 막혔다네요.

 

 

 

 

저번처럼 GNS3 VM에 lrzsz를 설치해서 올릴수도 있지만 이번엔 SFTP로 올려봅니다.

 

 

 

 

이제 콘솔을 열어서

 

 

 

 

python3 CiscoIOUKeygen.py 명령으로 키젠을 돌려주면 키값이 보입니다.

 

메모장으로 IOURC.txt 파일을 만들어서 안에

 

[license]

gns3vm = 73635fd3b0a13ad0;

 

이라고 적어서 저장해주시면 됩니다. 키값 끝에는 세미콜론이 있어야 합니다.

 

 

 

8. 라이센스파일 등록 및 IOU 이미지 업로드

 

GNS3 Preferences를 열고 IOS on UNIX 항목을 선택합니다.

 

Browse를 눌러 IOURC.txt 파일을 지정하면 이전에 입력한 값이 보입니다.

 

 

 

 

이제 드디어 IOU 이미지를 올립니다. IOU Devices 에서 New를 눌러줍니다.

 

 

 

 

Browse를 누르고 IOU 이미지를 선택하면 저절로 GNS3 VM에 업로드됩니다. Type은 일치되는 값으로 지정합니다.

 

 

 

 

IOU 장비가 추가되었습니다.

 

 

 

 

장비리스트에서 끌어다 놓으면 콘솔포트가 할당됩니다.

 

 

 

 

Xshell로 접속해보면 부팅되는 것이 보입니다.

 

 

 

 

스위치에서만 적용되는 명령인 이더채널을 확인해봅니다.

 

 

 

 

최신버전의 GNS3 v2.1.11 에서 시스코 스위치 부팅 성공!

Posted by 비형랑#
:




콘솔로 장비를 설정하고 통신이 가능한 상태가 되면 콘솔보단 원격에서 장비를 관리하게 된다.
원격으로 장비에 접근하려면 텔넷이나 SSH를 사용해야 하는데, 텔넷은 데이터를 암호화하지 않아 캡쳐될 경우 설정내역이 그대로 노출되게 된다.
실습망과 같이 상용네트웍이 아니라면 텔넷을 사용해도 문제가 없지만 보안이 요구되는 네트워크의 경우 매우 치명적이다.
데이터를 암호화하여 전송하는 SSH를 적용하고, 포트번호도 기본값에서 바꿔주면 데이터의 유출과 무분별한 접근을 차단할 수 있다.

요구사항
k9(crypto)기능이 포함된 Cisco IOS image.
ex) c3750e-universalk9-tar.122-35.SE5.tar

1. 호스트네임 설정
Router(config)#hostname keysco
keysco(config)#

2. 도메인네임 설정
keysco(config)#ip domain-name keysco.com
keysco(config)#

3. RSA 키 생성 (시스코 권고안에 따라 1024비트 사용)
keysco(config)#crypto key generate rsa  
The name for the keys will be: keysco.keysco.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

keysco(config)#
*Mar  1 00:02:18.263: %SSH-5-ENABLED: SSH 1.99 has been enabled
keysco(config)#


4. 인증을 위한 계정 설정
keysco(config)#username cisco secret cisco
keysco(config)#enable secret cisco

5. 계정 인증 및 SSH 접근 설정
keysco(config)#line vty 0 4
keysco(config-line)#login local
keysco(config-line)#transport input ssh
keysco(config-line)#

6. SSH 파라미터 설정 (v1보다 보안이 강력한 v2적용. v1+v2: no ip ssh version)
keysco(config)#ip ssh version 2
keysco(config)#ip ssh time-out ?
  <1-120>  SSH time-out interval (secs)

keysco(config)#ip ssh time-out 30
keysco(config)#ip ssh authentication-retries ?
  <0-5>  Number of authentication retries

keysco(config)#ip ssh authentication-retries 3
keysco(config)#

7. 포트 변경
keysco(config)#ip ssh port 2222 rotary 1 
keysco(config)#ip access-list extended sshBlock
keysco(config-ext-nacl)#permit tcp any any eq 2222
keysco(config-ext-nacl)#exit
keysco(config)#line vty 0 4
keysco(config-line)#rotary 1
keysco(config-line)#access-class sshBlock in

8. 검증
Xshell 5 (Build 1339)
Copyright (c) 2002-2017 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[c:\~]$ ssh 1.0.0.150 22


Connecting to 1.0.0.150:22...
Could not connect to '1.0.0.150' (port 22): Connection failed.

Type `help' to learn how to use Xshell prompt.
[c:\~]$ 
SSH 기본포트인 22번이 차단되었다.

Xshell 5 (Build 1339)
Copyright (c) 2002-2017 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[c:\~]$ ssh 1.0.0.150 2222


Connecting to 1.0.0.150:2222...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.


keysco>en
Password: 
keysco# 
새로 지정한 포트인 2222로 SSH연결이 성립되었다.

keysco#show ssh
Connection Version Mode Encryption  Hmac	 State	               Username
99         2.0     IN   aes128-cbc  hmac-sha1    Session started       cisco
99         2.0     OUT  aes128-cbc  hmac-sha1    Session started       cisco
%No SSHv1 server connections running.
keysco#
keysco#show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 30 secs; Authentication retries: 3
라우터에서 확인


Posted by 비형랑#
:



Router(config)#hostname R1
R1(config)#
▲ 호스트 네임 설정은 기본중의 기본


R1(config)#no ip domain-lookup
▲ 프리빌리지 모드에서 명령을 잘못 입력하면 도메인 찾는다고 쿼리를 날리는데 시간을 꽤나 잡아먹습니다..


R1(config)#no cdp run
▲ 인접한 시스코장비를 찾아내는 프로토콜인데 보안에 굉장히 취약하므로 비활성화합니다.


R1(config)#vtp mode transparent
▲ VTP는 거의 사용하지 않으니 데이터를 교환하지 않는 transparent모드로 설정합니다.


R1(config)#line aux 0
R1(config-line)#no password
R1(config-line)#login
▲ 사용하지 않는 AUX라인은 사전에 접속을 차단합니다.


R1(config)#enable secret [password]
R1(config)#username [username] secret [password]

R1(config)#line con 0
R1(config-line)#login local

R1(config)#line vty 0 4
R1(config-line)#login local
R1(config-line)#transport input [all | ssh | telnet | none] 
▲ 관리자 계정 만들고 설정모드 암호를 만들고 암호화시킵니다. 원격접속시 텔넷을 쓸지 SSH를 쓸지 지정합니다.
보다 세부적인 SSH설정을 하고 싶다면

2016/11/27 - 시스코 장비 SSHv2 설정하기 - 임의 포트 부여



Posted by 비형랑#
:

GNS3 v.2.1.11의 최신버전으로 새로 작성한 글이 있으니 참고하세요.


https://se34.tistory.com/72






원래 시스코는 라우터만 만들던 회사였으나,

스위치를 만들던 회사인 카탈리스트를 인수하여 스위치까지 만드는 회사가 됩니다.


당시 카탈리스트에서 만드는 스위치에는 독자적인 CatOS(Catalyst-OS)를 탑재하였는데

시스코는 카탈리스트를 인수한 뒤에도 스위치의 운영체제로 CatOS를 유지합니다.


때문에 같은 회사의 제품임에도 불구하고 라우터와 스위치에 올라가는 운영체제가 다르게 되었는데,

이때문에 현재 스위치 시뮬레이터를 구동하는데 많은 어려움을 겪고 있습니다.


시스코의 라우터에 탑재되는 IOS라는 녀석은,

2005년도 즈음에 만들어진 다이나밉스(Dynamips)라는 무료 시뮬레이터 덕에

라우터의 IOS만 구하면 실제 라우터의 동작 99%를 가상으로 구현할 수 있었습니다.


비록 패킷트레이서처럼 토플로지를 직접 보면서 작업할 수도 없고, 설정도 약간 복잡한 편이지만

당시에는 패킷트레이서에 RIP인증도 없었고 안되는게 많았을 때라 다이나밉스를 거의 필수로 사용했습니다.


나중에는 다이나밉스를 기반으로한 Graphical Network Simulator 3, GNS3의 등장으로 매우 쉽게 라우터를 시뮬레이션 하게 됩니다.


다이나밉스가 0.2.8의 버전으로 정식 업그레이드를 종료했음에도 불구하고 GNS3개발자덕에 지속적으로 유지하고 있고,

나중엔 VPCS(Virtual PC Simulator), Wireshark, Host 브리징 등의 강력한 툴과 기능들을 시뮬레이터에 통합시킴으로써 많은 사용자를 확대해 나갑니다.


다만 CatOS의 특성상 다이나밉스에서 구동이 불가능해서 다이나밉스에서 스위치를 시뮬레이션 할수 없었습니다.

네트웍의 주요 장비인 L2스위치를 시뮬레이션 할 수 없다것은 네트워크 시뮬레이터로서는 치명적인 단점이었습니다.


하지만 GNS3 외에 달리 대안도 없기에 차선책으로 사용한 방법이 라우터에 NM-16ESW라는 스위칭 인터페이스를 꽂아 쓰는 것이었지만, 역시 라우터에 꽂아 쓰는 것이기에 실제 스위치와는 명령이 매우 다를 수 밖에 없었습니다.

간단한 VLAN등의 구현은 가능하지만 세부적인 STP조정, 이더채널 프로토콜 지정이 불가능 했으니 그저 더미허브보다 약간 나은 수준이었습니다. 요즘은 VLAN지정이 가능한 공유기도 나오니 고급 공유기 수준이랄까요.


최근 L3스위치를 가지고 실습할 게 많아져서 어쩔수 없이 패킷트레이서를 쓰고 있었습니다만

버전업이 되면서 명령이 많아졌다고 해도 역시 한계가 있더군요. 실제 돌아다니는 패킷을 캡쳐해볼수도 없고..


그래서 구글에서 검색에 검색을 거듭한 결과 IOS on UNIX, IOU라는 장비 시뮬레이터를 알게 됩니다.

대충 알아보니 시스코 내부 직원들이 교육용으로 사용한다는데, 장비 운영체제를 유닉스에서 가상으로 구동시켜놓고

그 유닉스에 접근해서 장비를 설정하는 개념이더군요. (그래서 Cisco IOU는 오픈소스가 아닙니다. 아쉽게도..)


그래서 이것저것 삽질해가며 IOU기반의 L2스위치를 GNS3에서 돌려보았습니다. 가장 먼저 확인한 것은 이더채널 커맨드..

LACP, PAgP 모두 구현 가능합니다. 드디어 카탈리스트 스위치를 GNS3에서 돌릴수 있습니다.


제가 늦게 알게 된건진 모르지만, 그래도 아직은 아는 분보단 모르는 분이 많을거 같아 구현하는 방법을 남겨봅니다.

(실제 이유가 다음에 또 헤매지 않기 위함인건 안비밀. 많이 헤맸습니다..)


스위치를 시뮬로 돌리게 되서 감동해서인지 서론이 길었습니다. 밑에 과정만 잘 따라와 주시면 됩니다~





0. GNS3는 당연히 깔려 있어야 합니다.


GNS3 다운로드: https://www.gns3.com/software


계정만드시고 로그인 하면 무료로 받을수 있습니다.



1. 가상화 솔루션 설치.


GNS3 가상머신을 구동시켜줄 가상화 솔루션을 설치해야합니다.


VMware Workstation Player(비상업용), Oracle VirtualBox는 무료입니다.


VMware Workstation Player 다운로드: http://www.vmware.com/products/player/playerpro-evaluation.html

Oracle VirtualBox 다운로드: https://www.virtualbox.org/wiki/Downloads




2. GNS3에서 제공하는 가상머신 파일(*.ova) 다운로드


가상화 솔루션에서 구동할 GNS3 가상머신을 내려받습니다.


https://github.com/GNS3/gns3-gui/releases


스크롤 쭈욱 내리시면 알파버전이 아닌 안정된 버전이 나옵니다.


사용할 GNS3와 버전이 일치해야 합니다. 원래 사용하던 GNS3는 1.4.x 였는데 가상머신을 1.5.3 받으니 에러 나더군요.


저는 VMware에서 구동할 것이기 때문에 VMware버전을 받았습니다





3. 가상머신에서 구동할 IOU 장비의 이미지 구하기


GNS3를 사용하기 전에 IOS를 추가하듯이, IOU장비도 이미지를 구해서 추가합니다.

구글에 검색하시면 구하실수 있을 겁니다.


이미지는 L2, L3가 있는데 구동해보니 L2는 L3스위치, L3는 라우터로 동작하는듯 합니다.






4. VMware, VirtualBox등의 가상화 솔루션에서 가상머신 파일 불러오기


이제 가상화 솔루션을 실행킵니다.


파일 들어가서 오픈 선택하시고 내려받은 "GNS3 VM.ova" 선택하시면 가상머신이 하나 추가됩니다.


사실 이 가상머신에서 모든 장비를 구현하라는게 GNS3의 권고안이고,


더 적은 CPU와 RAM을 가지고 많은 장비를 돌릴수 있습니다만


로컬서버에서 라우터를 돌리는게 확장성에서 더 유리하므로 IOU장비만 VM에서 구동하기로 합니다.




5. 가상화장치 부팅


가상머신을 설정하기 위해 부팅시킵니다. 우분투14.04 기반의 리눅스 시스템입니다.


vi는 없는데 python3는 올라가 있는 정말 요상한(?) 시스템입니다.


메롱하는 부팅이 끝나면 부팅된 GNS3 VM의 버전, IP, SSH계정 정보가 보입니다.







6. IOU License Generator를 가상머신으로 전송


IOU라는 시뮬레이터는 프리웨어가 아니라서 인증된 키파일을 올려야 사용할 수 있습니다.

이 키값이 디바이스마다 상이하므로 가상머신 내부에서 알아내야 합니다.


키젠은 "CiscoIOUKeygen.py" 라고 검색하시면 바로 나옵니다만.. 귀찮으신 분들을 위해!


http://forum.gns3.net/download/file.php?id=2950


받은 키젠을 가상머신에 올리는 방법은..


    - 웹 브라우저 열어서 <가상머신의아이피>:3080 입력하시면 흰색 배경의 GNS3 웹 페이지가 나옵니다.

    - 업로드 메뉴 들어가서 키젠 파일을 업로드 합니다.





업로드가 정상적으로 완료되면 파일의 경로가 리스트에 보이게 됩니다.


이게 정상적인 파일 업로드 방법 입니다만..

이전에는 업로드 단계에서 에러가 나서 SSH들어가서 ZMODEM으로 올렸습니다;;




7. 키젠 구동해서 키값 확인


GNS3 VM의 커맨드를 띄웁니다. 초기화면에서 OK를 누르고 Shell을 선택합니다.






키젠이 위치한 곳으로 경로를 옮기고 파일을 확인해봅니다.





이제 키젠을 구동해서 키값을 알아내면 됩니다만, 여기에서 삽질을 조금 했습니다.

현재 웹에 돌아다니는 키젠은 Python 2.7기준으로 작성된 것이 대부분인데,

최신의 GNS3 가상머신에는 Python 3가 기본으로 설치되어 있습니다.


따라서 키젠을 열어서 3버전으로 수정하시거나, Python 2.7을 설치하셔서 키젠을 구동해야 하지만

찾아보니 이미 GNS3 포럼에 Python 2.7, 3 모두 구동가능하도록 수정한 버전이 올라와있더군요.

올려주신 분이 무려 GNS3의 내부 패키지를 수정하시는 분입니다;;





6번 단계에 올려 놓은 링크는 수정된 버전의 키젠이니 실행만 하시면 됩니다. 아래처럼 키값이 보이면 성공입니다.





8. IOURC파일 만들기


IOURC파일 별거 없습니다. IOU의 라이센스를 인증하는 파일인데 2줄짜리 텍스트 파일입니다.


[license]

gns3vm = xxxxxxxxxxxxxxxx;


x표 한곳에 키젠에서 얻은 키값을 넣으시고 IOURC.txt 로 저장하시면 됩니다.

키값의 끝은 세미콜론이 있어야 에러가 안납니다.




9. GNS3에서 IOU설정


GNS3에서 가상머신, IOURC파일을 지정하고 IOU장비를 추가해야 합니다.


GNS3를 켜고 메뉴의 Edit - Preferences 로 들어갑니다



▲ Virtualization software는 설치한 가상화 솔루션을 고르시면 됩니다. VM name도 마찬가지..





▲ IOS on UNIX로 넘어와서.. IOURC파일의 위치를 지정해줍니다.




마지막으로.. 3번에서 받은 장비 이미지 파일을 L2, L3구분해서 IOU Devices에 추가해 주시면 설정은 끝납니다.




설정창 닫으시고 장비리스트 열어보시면 못보던 장비가 보일겁니다.


토플로지에 살포시 드래그 해놓으시고 스타트 해보시면 됩니다~


라우터에는 없는 커맨드.. 이더채널 명령이 모두 보입니다.





처음 설정할때는 2시간 정도 걸렸는데


캡쳐뜨려고 다시 해봤더니 10분도 안걸리네요.. ㅠㅠ




다른분들은 부디 저처럼 헤매지 마시길..

Posted by 비형랑#
:

LACP & PAgP

Cisco R&S 2016. 8. 25. 10:00 |
LACP와 PAgP는 이더채널(EtherChannel)이라는 솔루션의 프로토콜이다.


LACP - Link Aggregation Control Protocol

PAgP - Port Aggregation Protocol




2대의 스위치를 2개이상의 선으로 연결하면 STP에 의해 1개의 링크만 남기고 블로킹시킨다. 따라서 여러개의 링크가 있음에도 불구하고 모두 활용하지 못하고 1개만을 사용하는 비효율성이 발생한다. 이더채널은 물리적으로 연결된 다중링크를 1개의 논리링크로 묶어주는 솔루션이다. 이더채널을 이용하면 대역폭을 증가시킬수 있고 STP를 사용하지 않으므로 Fail-over 타임이 극단적으로 짧아진다. (어쩌면, Fail이 발생하지 않는다고 봐야 맞나?)


LACP는 IEEE802.3ad로 정의된 표준 프로토콜, PAgP는 Cisco고유 프로토콜이다. LACP는 최대 16개 포트, PAgP는 최대 8개 포트까지 지정할 수 있으나 이더채널로 활성화 할수 있는 링크는 최대 8개로 동일하다. LACP는 묶고 남은 8개의 포트를 백업의 의미로 사용한다.


커맨드는 다음과 같다.

Switch0(config)#int range g 0/1 - 2
Switch0(config-if-range)#channel-protocol lacp
Switch0(config-if-range)#channel-group 1 mode active

Switch1(config)#int range g 0/1 - 2
Switch1(config-if-range)#channel-protocol lacp
Switch1(config-if-range)#channel-group 1 mode passive


채널그룹의 모드는 5가지가 있으며 다음과 같다.

Switch(config-if-range)#channel-group 1 mode ?
  active Enable LACP unconditionally
  auto Enable PAgP only if a PAgP device is detected
  desirable Enable PAgP unconditionally
  on Enable Etherchannel only
  passive Enable LACP only if a LACP device is detected



active모드는 상대 스위치에게 먼저 물어본다.

passive모드는 상대스위치가 먼저 말을 걸을 때까지 가만히 있는다.

양쪽 모두 passive 설정되면 이더채널이 구현되지 않는다.


desirable모드는 상대 스위치에게 먼저 물어본다.

auto모드는 상대스위치가 먼저 말을 걸을 때까지 가만히 있는다.

양쪽 모두 auto 설정되면 이더채널이 구현되지 않는다.


on모드는 상대 스위치와 상관없이 이더채널을 활성화한다.


LACP는 9개 이상의 링크중에서 활성화할 8개의 포트를 선정하기 위해 우선순위를 부여할 수 있다.

switch(config-if)#lacp port-priority [priority]


이더채널로 설정된 인터페이스는 다중의 인터페이스가 한개의 논리링크로 동작하기 때문에 IP주소나 트렁킹 설정을 Port-channel 인터페이스에서 해주어야 한다.

switch(config)#int port-channel [group number]
switch(config-if)#


패킷트레이서보다 실제에 가까운 실습환경을 원한다면?


2018/10/21 - 시스코 카탈리스트 스위치 가상으로 구현하기 - IOU, GNS3 v2.1.11




Posted by 비형랑#
:

GLBP - Gateway Load Balancing Protocol


Reference.

https://cisconinja.wordpress.com/2009/02/11/glbp-weights-load-balancing-and-redirection/


GLBP를 제대로 이해하는데 자그마치 2일이 걸렸습니다.. weight개념 까지는 쉬웠는데 threshold를 어떻게 쓰는지 이해가 안되서요. 영어만 잘했어도 쉽게 알아들었을 텐데 영어는 언제나 넘사벽이라서.. 예제 하나하나 해보고 뜯어보는데 시간이 많이 걸렸네요. 그래도 덕분에 기억은 오래갈듯 합니다. 이 글을 통해 타이머조정, 인증(인증은 쉬우니까)을 제외한 GLBP의 전부를 마무리 해봅니다.




HSRP, VRRP는 그룹내에서 하나의 라우터만 액티브라우터가 되어 게이트웨이 역할을 수행하므로 다른 라우터들을 유휴상태로 방치하는 비효율의 문제가 있었다.


이러한 문제점을 극복하고자 네트워크 별로 액티브라우터를 다르게 설정하여 트래픽을 분산할 수도 있으나(Multiple-HSRP, Multiple-VRRP), 한 네트워크에 트래픽이 몰리는 경우 마찬가지로 하나의 라우터에만 트래픽이 집중되므로 궁극적인 해결책이 되진 못한다.


이 문제를 해결하기 위한 것이 GLBP이다. 단일 IP로 게이트웨이를 이중화하고, 여러 라우터로 로드밸런싱도 가능하다. 단, 시스코의 독자적인 프로토콜이므로 모든 장비에서 구현할 수 있는것은 아니다.


GLBP는 라우터마다 별개의 가상 MAC주소를 부여하며 이 MAC주소들을 로드밸런싱 규칙에 따라 ARP응답하여 부하를 분산시킨다.


GLBP 그룹별로 하나의 Active Virtual Gateway가 선출된다. AVG선출의 기준은 AVG Priority가 높은 라우터, 동일할경우 높은 IP를 가진 라우터이다. 이 AVG는 그룹내 라우터들에게 최대 4개의 가상 MAC주소를 부여한다. 2번째 우선순위의 라우터는 Stanby AVG가 된다.


AVG로부터 가상 MAC주소를 부여받은 라우터를 Active Virtual Forwarder라고 한다. AVG가 부여할수 있는 가상 MAC주소가 최대 4개이므로, 최대 동작가능한 AVF의 수도 4개가 된다. 그래서 GLBP에는 Forwarder#1, Forwarder#2, Forwarder#3, Forwarder#4의 4개의 AVF그룹이 있고, GLBP그룹에 참여하는 순서대로 Forwarder#1, Forwarder#2, Forwarder#3, Forwarder#4의 owner가 된다.


GLBP에서 weight는 라우터별로 부하분산할 비율을 결정한다. 성능이 좋은 라우터는 weight를 많이, 반대의 경우 적게 설정한다. 또한 인터페이스 트래킹을 통해 weight를 동적으로 조정하거나 아예 AVF가 되지 못하도록 설정할 수 있다. lower threshold값은 AVF가 되지 못하게 할 weight 임계값, upper threshold값은 다시 AVF가 되게 할 임계값이다.


GLBP의 로드밸런싱 규칙은 3가지를 적용할 수 있다.


1. Round Robin - 가장 간단, ARP요청별로 AVF의 MAC주소를 순차로 응답. 모든 AVF트래픽 동일

2. Weighted - AVF마다 설정된 비율로 부하분산 [Ra% = Wa/(Wa+Wb+Wc+Wd)]

3. Host-dependent - 특정 호스트에게 특정 AVF를 거치도록 설정


======================================================================================




R1부터 순차적으로 AVF가 되도록 하기 위해 커맨드 순서를 다음과 같이 입력한다.



R1(config)#int f 0/0

R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#mac 0.0.1
R1(config-if)#no sh
R1(config-if)#
*Mar  1 00:01:26.239: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:01:27.239: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#glbp 1 pre
R1(config-if)#glbp 1 pri 101
R1(config-if)#glbp 1 ip 10.1.1.100
R1(config-if)#ex
R1(config)#
*Mar  1 00:02:05.051: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
R1이 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:02:15.051: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active
R1이 GLBP 1번 그룹의 1번 AVF가 됨


R2(config)#int f 0/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#mac 0.0.2
R2(config-if)#no sh
R2(config-if)#
*Mar  1 00:03:27.707: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:03:28.707: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#glbp 1 pre
R2(config-if)#glbp 1 pri 102
R2(config-if)#glbp 1 ip 10.1.1.100
R2(config-if)#ex
R2(config)#
*Mar  1 00:03:51.195: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R2가 GLBP 1번 그룹의 AVG가 됨

*Mar  1 00:04:04.195: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 2 state Listen -> Active

R2가 GLBP 1번 그룹의 2번 AVF가 됨
R1(config)#
*Mar  1 00:07:26.099: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak
R1이 AVG에서 박탈됨


R3(config)#int f 0/0
R3(config-if)#ip add 10.1.1.3 255.255.255.0
R3(config-if)#mac 0.0.3
R3(config-if)#no sh
R3(config-if)#
*Mar  1 00:08:45.367: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:08:46.367: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#glbp 1 pre
R3(config-if)#glbp 1 pri 103
R3(config-if)#glbp 1 ip 10.1.1.100
R3(config-if)#ex
R3(config)#
*Mar  1 00:09:15.107: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R3가 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:09:28.107: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 3 state Listen -> Active

R3가 GLBP 1번 그룹의 3번 AVF가 됨

R2(config)#

*Mar  1 00:13:15.263: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak

R2 AVG에서 박탈됨


R4(config)#int f 0/0
R4(config-if)#ip add 10.1.1.4 255.255.255.0
R4(config-if)#mac 0.0.4
R4(config-if)#no sh
R4(config-if)#
*Mar  1 00:08:27.647: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:08:28.647: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4(config-if)#glbp 1 pre
R4(config-if)#glbp 1 pri 104
R4(config-if)#glbp 1 ip 10.1.1.100
R4(config-if)#ex
R4(config)#
*Mar  1 00:08:47.767: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active

R4가 GLBP 1번 그룹의 AVG가 됨
*Mar  1 00:09:00.767: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 4 state Listen -> Active

R4가 GLBP 1번 그룹의 4번 AVF가 됨

R3(config)#
*Mar  1 00:11:42.179: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak

R3가 AVG에서 박탈됨


R5(config)#int f 0/0
R5(config-if)#ip add 10.1.1.5 255.255.255.0
R5(config-if)#mac 0.0.5
R5(config-if)#no sh
R5(config-if)#
*Mar  1 00:09:14.239: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:09:15.239: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up


여기까지 설정하고 GLBP상태를 확인해보면 R4가 AVG로 선정되었으며 Forwarder1은 R1, Forwarder2는 R2, Forwarder3는 R3, Forwarder4는 R4가 된 것을 알 수 있다.


R4(config)#do show glbp brief
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   104 Active   10.1.1.100      local           10.1.1.3 첫번째줄이 AVG 상태
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.1        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Active   0007.b400.0104  local           -


R5까지 GLBP그룹에 참여시킨다.


R5(config-if)#glbp 1 pre
R5(config-if)#glbp 1 pri 105
R5(config-if)#glbp 1 ip 10.1.1.100
R5(config-if)#ex
R5(config)#
*Mar  1 00:17:06.191: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active

R5가 GLBP 1번 그룹의 AVG가 됨


다시한번 GLBP상태를 확인해보면


R5(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   105 Active   10.1.1.100      local           10.1.1.4
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.1        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R5가 AVG로 선정되었지만 4개의 AVF그룹에 대해 Listen상태임을 알 수 있다. GLBP는 가상 MAC주소를 4개까지 줄 수 있기에 R5에게 새로운 MAC주소를 주지 않으며 따라서 AVF가 될 수 없다.


R5의 weight를 증가시켜도 R5는 새로운 MAC주소를 받을 수 없다.


R5(config-if)#glbp 1 w 200


R5(config)#do sh glbp 
FastEthernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:04:31
  Virtual IP address is 10.1.1.100
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.012 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is local
  Standby is 10.1.1.4, priority 104 (expires in 8.440 sec)
  Priority 105 (configured)
  Weighting 200 (configured 200), thresholds: lower 1, upper 200
  Load balancing: round-robin
  Group members:
    0000.0000.0001 (10.1.1.1)
    0000.0000.0002 (10.1.1.2)
    0000.0000.0003 (10.1.1.3)
    0000.0000.0004 (10.1.1.4)
    0000.0000.0005 (10.1.1.5) local
  There are 4 forwarders (0 active)
  Forwarder 1
    State is Listen
    MAC address is 0007.b400.0101 (learnt)
    Owner ID is 0000.0000.0001
    Redirection enabled, 593.464 sec remaining (maximum 600 sec)
    Time to live: 14393.464 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.1 (primary), weighting 100 (expires in 3.460 sec)
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is 0000.0000.0002
    Redirection enabled, 595.456 sec remaining (maximum 600 sec)
    Time to live: 14395.452 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.2 (primary), weighting 100 (expires in 5.452 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is 0000.0000.0003
    Redirection enabled, 593.208 sec remaining (maximum 600 sec)
    Time to live: 14393.204 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.3 (primary), weighting 100 (expires in 3.204 sec)
  Forwarder 4
    State is Listen
    MAC address is 0007.b400.0104 (learnt)
    Owner ID is 0000.0000.0004
    Redirection enabled, 596.772 sec remaining (maximum 600 sec)
    Time to live: 14396.768 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.4 (primary), weighting 100 (expires in 6.768 sec)


R5의 weight를 기본값인 100에서 200으로 증가시켜도 AVF가 되지 않는다. AVF의 선정은 GLBP그룹에 참여한 순서대로 되기 때문에 기존의 AVF에 변화가 없는한 R5는 AVG임에도 불구하고 게이트웨이로 향하는 트래픽을 전달할 수 없다.


R1에 루프백을 만들고 인터페이스 트래킹을 구현해보자


R1(config)#int l 0
R1(config-if)#
*Mar  1 00:23:53.495: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 00:23:54.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#ex
R1(config)#track 1 int l 0 line-protocol
R1(config-track)#ex
R1(config)#int f 0/0
R1(config-if)#glbp 1 w 100 lower 90 upper 95 weight=100, 90이하일 경우 AVF박탈, 95이상일때 AVF회복
R1(config-if)#glbp 1 w track 1 decrement 20 track 1번이 죽으면 설정한 weight에서 20감소
R1(config-if)#ex
R1(config)#int l 0
R1(config-if)#sh 인터페이스 비활성화
R1(config-if)#
*Mar  1 00:25:44.923: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 00:25:45.923: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
*Mar  1 00:26:18.171: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Active -> Listen

1번 AVF에서 박탈당함
R1(config-if)#do sh glbp | section Forwarder 1
  Forwarder 1
    State is Listen
      2 state changes, last state change 00:00:44
    MAC address is 0007.b400.0101 (default)
    Owner ID is 0000.0000.0001
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.5 (secondary), weighting 200 (expires in 7.076 sec)


루프백 인터페이스를 비활성화하면 weight가 100에서 20을 뺀 80이 된다. 80은 lower threshold값인 90보다 낮으므로 R1은 AVF에서 박탈된다. 따라서 대신 놀고있던 R5가 1번 AVF가 되었다. 다만 유의할 점은 Owner ID가 R1의 MAC주소로 변함이 없다는 점이다.


R1(config)#int l 0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
*Mar  1 00:42:57.075: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 00:42:58.075: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
*Mar  1 00:43:35.927: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active

R1이 다시 1번 AVF가 됨


R1의 루프백을 다시 활성화시키니 R1의 weight가 100으로 회복되어 원래대로 1번 AVF가 되었다.


다른 케이스로 R5의 F0/0이 죽어있을 때 R1의 루프백을 죽인다면 1번 AVF는 누가 맡을지 확인한다


R5(config)#int f 0/0
R5(config-if)#sh
R5(config-if)#
*Mar  1 00:43:55.655: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Init
*Mar  1 00:43:57.651: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar  1 00:43:58.651: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down


R1(config)#int l 0
R1(config-if)#sh
R1(config-if)#
*Mar  1 00:49:52.439: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 00:49:53.439: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
*Mar  1 00:51:05.359: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Active -> Listen


R4(config)#

*Mar  1 00:41:32.807: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
*Mar  1 00:42:09.879: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active


R4(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   104 Active   10.1.1.100      local           10.1.1.3
Fa0/0       1    1   -   Active   0007.b400.0101  local           -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Active   0007.b400.0104  local           -


위와 같이 R5다음으로 우선순위가 높은 R4가 AVG가 되었고, R3가 Stanby AVG가 되었다. 또한 1번 AVF로 R4가 된 것을 확인할 수 있다. 4번 AVF도 Active 상태로 그대로 있다. 따라서 R4는 1번 AVF, 4번 AVF의 역할을 모두 수행하게 된다.


이 상황에서 R5의 F0/0을 살린다면 1번 AVF를 R4대신 R5가 수행할수 있을지 확인한다.


R5(config)#int f 0/0
R5(config-if)#no sh
R5(config-if)#
*Mar  1 00:54:09.043: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:54:10.043: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar  1 00:54:10.463: %GLBP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Active
R5(config-if)#ex
R5(config)#do show glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   105 Active   10.1.1.100      local           10.1.1.4
Fa0/0       1    1   -   Listen   0007.b400.0101  10.1.1.4        -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R5의 F0/0을 활성화하니 R5가 다시 AVG가 되었고 R4가 Stanby AVG가 되었다. 하지만 1번 AVF는 여전히 R4가 맡고있다.


R1(config)#int l 0
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#
*Mar  1 01:02:42.667: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Mar  1 01:02:43.667: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
*Mar  1 01:03:14.659: %GLBP-6-FWDSTATECHANGE: FastEthernet0/0 Grp 1 Fwd 1 state Listen -> Active

R1(config)#do sh glbp br
Interface   Grp  Fwd Pri State    Address         Active router   Standby router
Fa0/0       1    -   101 Listen   10.1.1.100      10.1.1.5        10.1.1.4
Fa0/0       1    1   -   Active   0007.b400.0101  local           -
Fa0/0       1    2   -   Listen   0007.b400.0102  10.1.1.2        -
Fa0/0       1    3   -   Listen   0007.b400.0103  10.1.1.3        -
Fa0/0       1    4   -   Listen   0007.b400.0104  10.1.1.4        -


R1의 루프백을 살리니 1번 AVF가 R1에게로 넘어갔다.


이번엔 AVF Preemption을 비활성화 한 뒤, R1의 루프백을 죽여보기로 한다.


R2(config)#int f 0/0
R2(config-if)#no glbp 1 forwarder preempt


R3(config)#int f 0/0
R3(config-if)#no glbp 1 forwarder preempt


R4(config)#int f 0/0
R4(config-if)#no glbp 1 forwarder preempt


R5(config)#int f 0/0
R5(config-if)#no glbp 1 forwarder preempt

R1(config)#int l 0
R1(config-if)#shutdown
R1(config-if)#
*Mar  1 01:10:15.787: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar  1 01:10:16.787: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down
R1(config-if)#
R1(config-if)#do show glbp
FastEthernet0/0 - Group 1
  State is Listen
    5 state changes, last state change 00:57:13
  Virtual IP address is 10.1.1.100
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.592 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is 10.1.1.5, priority 105 (expires in 8.156 sec)
  Standby is 10.1.1.4, priority 104 (expires in 9.636 sec)
  Priority 101 (configured)
  Weighting 80, low (configured 100), thresholds: lower 90, upper 95
    Track object 1 state Down decrement 20
  Load balancing: round-robin
  Group members:
    0000.0000.0001 (10.1.1.1) local
    0000.0000.0002 (10.1.1.2)
    0000.0000.0003 (10.1.1.3)
    0000.0000.0004 (10.1.1.4)
    0000.0000.0005 (10.1.1.5)
  There are 4 forwarders (1 active)
  Forwarder 1
    State is Active
      5 state changes, last state change 00:08:14
    MAC address is 0007.b400.0101 (default)
    Owner ID is 0000.0000.0001
    Preemption enabled, min delay 30 sec
    Active is local, weighting 80
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is 0000.0000.0002
    Time to live: 14399.200 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.2 (primary), weighting 100 (expires in 9.196 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is 0000.0000.0003
    Time to live: 14399.192 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.3 (primary), weighting 100 (expires in 9.188 sec)
  Forwarder 4
    State is Listen
    MAC address is 0007.b400.0104 (learnt)
    Owner ID is 0000.0000.0004
    Time to live: 14397.368 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.4 (primary), weighting 100 (expires in 7.364 sec)


weight가 80으로 떨어졌음에도 불구하고 R1이 1번 AVF에서 박탈되지 않는다.


AVF별로 로드밸런싱이 되는것을 확인하려면


Rx(config-if)#glbp 1 client-cache maximum 30

Rx#show glbp detail

Posted by 비형랑#
:

VRRP - Virtual Router Redundancy Protocol

HSRP는 시스코 고유의 프로토콜이나, VRRP는 IETF 표준 RFC 2338로 정의된 표준 프로토콜이다.

HSRP와 설정방법이 거의 유사하지만 약간의 차이가 있다.


2016/08/16 - HSRP - Hot Standby Router Protocol - HSRP는 여기 참고

1. 액티브라우터가 아닌 마스터라우터이다.

2. HSRP Priority는 0-255, VRRP Priority는 1-254

3. 마스터라우터의 MAC은 0000.5e00.01XX, XX는 그룹번호

4. VRRP Advertisement는 1초마다

5. 인터페이스 트래킹을 별도의 트랙으로 설정해두어야 함. - 세부설정 가능!



위의 토플로지의 R1과 R2의 이더넷인터페이스에 VRRP를 적용하여 가상의 라우터를 만들되 R1이 마스터라우터가 되도록 설정한다.

또한 R1의 시리얼링크에 문제가 생길경우 R2가 마스터라우터가 되도록 한다.

========================================================================================

R1설정

track 1 interface Serial2/0 line-protocol  "line-protocol"대신 "ip routing"으로 입력하면 L3감지
       
interface FastEthernet0/0
 ip address 192.168.10.252 255.255.255.0
 vrrp 10 ip 192.168.10.254
 vrrp 10 priority 110
 vrrp 10 track 1 decrement 100


R2설정

interface FastEthernet0/0
 ip address 192.168.10.253 255.255.255.0
 duplex auto
 speed auto
 vrrp 10 ip 192.168.10.254
 vrrp 10 priority 50


========================================================================================

설정결과확인

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 110
    Track object 1 state Up decrement 100
  Master Router is 192.168.10.252 (local), priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.570 sec


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Backup 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.252, priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec (expires in 2.960 sec)

========================================================================================

CASE1# R1의 F0를 shutdown

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Init   
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 110
    Track object 1 state Up decrement 100
  Master Router is unknown, priority is unknown
  Master Advertisement interval is unknown
  Master Down interval is unknown


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.253 (local), priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec

========================================================================================

CASE2# R3의 S0을 shutdown

R1#show vrrp
FastEthernet0/0 - Group 10
  State is Backup 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 10  (cfgd 110)
    Track object 1 state Down decrement 100
  Master Router is 192.168.10.253, priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.570 sec (expires in 3.090 sec)


R2#show vrrp
FastEthernet0/0 - Group 10
  State is Master 
  Virtual IP address is 192.168.10.254
  Virtual MAC address is 0000.5e00.010a
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 50 
  Master Router is 192.168.10.253 (local), priority is 50 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.804 sec

========================================================================================

다중 VRRP설정은 HSRP와 동일하므로 생략~

2016/08/16 - HSRP - Multiple Group Configuration


Reference.

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipapp_fhrp/configuration/12-4/fhp-12-4-book/fhp-vrrp.html#GUID-A6F936CD-71DF-4407-A943-3BD35389049A

https://www.ietf.org/rfc/rfc2338.txt

https://tools.ietf.org/html/rfc5798 - VRRPv3

Posted by 비형랑#
:

2016/08/16 - HSRP - Hot Standby Router Protocol


이전글에서 제시한 HSRP에는 트래픽이 한곳으로만 집중된다는 문제점이 있다.

게이트웨이를 이중화하여 두개의 경로를 모두 사용하는것이 아니라,

하나의 경로를 사용하되, 장애에 대비한 백업경로를 두는 개념이기 때문이다.

이러한 문제점은 네트워크별로 여러개의 HSRP를 설정하여 액티브라우터를 분산시키면 해결된다.

=======================================================================================


위의 토플로지에서 PC1은 VLAN10에 연결되어있고, PC2는 VLAN20에 연결되어 있다.

VLAN10의 액티브라우터는 R1, VLAN20의 액티브라우터는 R2가 되도록 HSRP를 설정한다.


R1설정

interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.252 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 110
 standby 10 preempt
 standby 10 track Serial2/0 100
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.252 255.255.255.0
 standby 20 ip 192.168.20.254
 standby 20 priority 50


R2설정

interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.253 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 50
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.253 255.255.255.0
 standby 20 ip 192.168.20.254
 standby 20 priority 110
 standby 20 preempt
 standby 20 track Serial2/0 100

========================================================================================

설정결과확인

R1#show stan
FastEthernet0/0.10 - Group 10
  State is Active
    2 state changes, last state change 02:04:49
  Virtual IP address is 192.168.10.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.368 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.10.253, priority 50 (expires in 9.368 sec)
  Priority 110 (configured 110)
    Track interface Serial2/0 state Up decrement 100
  IP redundancy name is "hsrp-Fa0/0.10-10" (default)
FastEthernet0/0.20 - Group 20
  State is Standby
    4 state changes, last state change 02:00:42
  Virtual IP address is 192.168.20.254
  Active virtual MAC address is 0000.0c07.ac14
    Local virtual MAC address is 0000.0c07.ac14 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.356 secs
  Preemption disabled
  Active router is 192.168.20.253, priority 110 (expires in 7.468 sec)
  Standby router is local
  Priority 50 (configured 50)
  IP redundancy name is "hsrp-Fa0/0.20-20" (default)


R2#show stan
FastEthernet0/0.10 - Group 10
  State is Standby
    4 state changes, last state change 02:03:48
  Virtual IP address is 192.168.10.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.808 secs
  Preemption disabled
  Active router is 192.168.10.252, priority 110 (expires in 8.864 sec)
  Standby router is local
  Priority 50 (configured 50)
  IP redundancy name is "hsrp-Fa0/0.10-10" (default)
FastEthernet0/0.20 - Group 20
  State is Active
    1 state change, last state change 02:02:39
  Virtual IP address is 192.168.20.254
  Active virtual MAC address is 0000.0c07.ac14
    Local virtual MAC address is 0000.0c07.ac14 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.808 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.20.252, priority 50 (expires in 7.500 sec)
  Priority 110 (configured 110)
    Track interface Serial2/0 state Up decrement 100
  IP redundancy name is "hsrp-Fa0/0.20-20" (default)


========================================================================================


PC1은 R3로 가기위해 R1을 경유하나, R1이나 R1의 시리얼링크에 문제가 생긴경우 R2를 경유한다.

PC2는 R3로 가기위해 R2를 경유하나, R2나 R2의 시리얼링크에 문제가 생긴경우 R1을 경유한다.

Posted by 비형랑#
:

HSRP - Hot Standby Router Protocol

PC나 서버등의 호스트에는 게이트웨이를 하나만 지정할 수 있다.

(꼭 그런건 아니지만)

그래서 라우터를 여러대 놓아도 하나의 라우터만을 통해 바깥망으로 나가게 된다.

이에 대한 솔루션으로 여러대의 라우터에 가상의 단일주소를 부여하여

게이트웨이의 가용성을 높일 수 있다.

HSRP는 v1, v2가 있으며 Cisco 고유 프로토콜이다.

버전이 다를경우 동작하지 않으며, 그룹별로 다른 버전을 사용할 수 있다.


 

 목적지 주소

그룹번호

액티브라우터 MAC

 version 1

 224.0.0.2


CGMP와 동일주소, HSRP동시사용 불가

 0-255

 0000.0c07.acXX


XX는 그룹번호

 version 2

 224.0.0.102


중복주소 없음

 0-4095

 0000.0c9f.fXXX


XXX는 그룹번호



=======================================================================================


위의 토플로지에서 PC1은 R3로 가기위해 R1을 거칠수도 있고 R2를 거칠수도 있다.

평상시에는 R1을 거쳐가다가, R1이 죽거나 R1의 시리얼링크에 문제가 생길경우 R2를 거쳐가도록 하는 가상라우터 주소를 설정한다.


R1 설정

interface FastEthernet0

ip address 192.168.10.252 255.255.255.0

standby 1 ip 192.168.10.254  그룹번호:1, 가상라우터:192.168.10.254, 이 명령으로 HSRP동작 시작

standby 1 priority 110  (디폴트인 100보다 높은 값)

standby 1 preempt  (프리엠프트 - R1이 죽었다 살았을때 다시 액티브라우터가 되도록)

standby 1 track Serial0 decrement 100  (시리얼이 죽으면 Priority를 100감소, 110-100=10이 된다)


R2 설정

interface FastEthernet0

ip address 192.168.10.253 255.255.255.0

standby 1 ip 192.168.10.254

standby 1 priority 50


=======================================================================================


설정결과 확인


R1#show standby

FastEthernet0 - Group 1

State is Active

6 state changes, last state change 00:00:12

Virtual IP address is 192.168.10.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.056 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.253, priority 10 (expires in 7.280 sec)

Priority 110 (configured 110)

Track interface Serial0 state Up decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Standby

4 state changes, last state change 00:11:30

Virtual IP address is 192.168.10.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.060 secs

Preemption disabled

Active router is 192.168.10.252, priority 110 (expires in 7.224 sec)

Standby router is local

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


=======================================================================================


CASE1# R1의 F0를 shutdown


R1#show stand

FastEthernet0 - Group 1

State is Init (interface down)

5 state changes, last state change 00:00:07

Virtual IP address is 192.168.10.254

Active virtual MAC address is unknown

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Preemption enabled

Active router is unknown

Standby router is unknown

Priority 110 (configured 110)

Track interface Serial0 state Up decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Active

5 state changes, last state change 00:00:51

Virtual IP address is 192.168.10.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.848 secs

Preemption disabled

Active router is local

Standby router is unknown

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


CASE2# R3의 S0을 shutdown


R1#show stand

FastEthernet0 - Group 1

State is Active

4 state changes, last state change 00:13:29

Virtual IP address is 192.168.10.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.952 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.253, priority 10 (expires in 7.792 sec)

Priority 10

Track interface Serial0 state Down decrement 100

IP redundancy name is "hsrp-Fa0-1" (default)


R2#show stand

FastEthernet0 - Group 1

State is Standby

4 state changes, last state change 00:14:26

Virtual IP address is 192.168.10.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.724 secs

Preemption disabled

Active router is 192.168.10.252, priority 5 (expires in 7.192 sec)

Standby router is local

Priority 50 (configured 50)

IP redundancy name is "hsrp-Fa0-1" (default)


=======================================================================================

R1: 액티브라우터

R2: 스탠바이라우터


R1의 이더넷이 죽으면 R2가 액티브라우터가 된다

(192.168.10.254의 패킷을 R2가 처리한다)


R1의 시리얼이 죽으면 R2가 액티브라우터가 되진 않지만,

R1의 Priority가 110-100=10으로 낮아짐에 따라

R2의 Priority가 더 높아진다

(192.168.10.254의 패킷을 R2가 처리한다)


=======================================================================================

Reference


http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3560/software/release/12-2_52_se/configuration/guide/3560scg/swhsrp.html


https://www.ietf.org/rfc/rfc2281.txt


=======================================================================================


HSRP 커맨드 입력시 순서가 매우 중요하다. priority 설정후 preempt를 적용하면 priority 설정이 날아가버리기 때문이다.


액티브라우터를 설정할경우 preempt, priority, ip 순으로 설정해야 한다.

'Cisco R&S' 카테고리의 다른 글

LACP & PAgP  (0) 2016.08.25
GLBP - Gateway Load Balancing Protocol  (0) 2016.08.20
VRRP - Virtual Router Redundancy Protocol  (0) 2016.08.16
HSRP - Multiple Group Configuration  (0) 2016.08.16
VPN(PPTP) Server Configuration  (0) 2015.12.25
CCNA Labsim 공부할 수 있는 곳  (0) 2015.04.27
ip default-network  (0) 2015.04.16
Port-security  (0) 2015.04.15
Posted by 비형랑#
:

R(config)#vpdn enable
R(config)#vpdn-group 1
R(config-vpdn)#accept-dialin
R(config-vpdn-acc-in)#protocol pptp
R(config-vpdn-acc-in)#virtual-template 1

R(config)#interface virtual-template 1
R(config-if)#ip unnumbered G 0/1
R(config-if)#peer default ip address pool test
R(config-if)#no keepalive
R(config-if)#ppp encrypt mppe 128
R(config-if)#ppp authentication ms-chap ms-chap-v2
R(config-if)#ppp mtu adaptive

R(config)#ip local pool test 192.168.0.20 192.168.0.25

R(config)#username test1 password test1

'Cisco R&S' 카테고리의 다른 글

GLBP - Gateway Load Balancing Protocol  (0) 2016.08.20
VRRP - Virtual Router Redundancy Protocol  (0) 2016.08.16
HSRP - Multiple Group Configuration  (0) 2016.08.16
HSRP - Hot Standby Router Protocol  (0) 2016.08.16
CCNA Labsim 공부할 수 있는 곳  (0) 2015.04.27
ip default-network  (0) 2015.04.16
Port-security  (0) 2015.04.15
라우터상의 arp테이블 해석  (0) 2015.04.14
Posted by 비형랑#
: