2022. 7. 3. 21:48ㆍNetwork
Gateway(게이트웨이)
일반적으로 프로토콜을 달리하는 두개의 네트워크(망) 또는 두 망의 통신계층 상호간에 서로 다른 프로토콜의 변환 기능을 수행하는 장치/관문을 말한다.
즉, 2개 이상의 이질적인 망을 연결시키는 개체(Entity)를 가리키는 매우 일반적인 용어이다.
게이트웨이는 LAN(근거리통신망)에서 많이 쓰이는 Ethernet망과 IBM사의 SNA망 간을 연결해주는 연동 장비로써 말할 수 있으며, TCP/IP에서 볼 때는 망간의 연결을 담당하는 3 Layer상의 라우터를 의미하기도 하나, 주로 상위 계층에서 상이한 프로토콜들 간의 특수한 변환을 담당하는 복잡한 S/W를 수행하는 서버를 의미한다.
ex) 전자우편을 여러 양식으로 바꿔주는 Mail gateway, VoIP에서 SIP 망 및 PSTN 간 연결장치(미디어게이트웨이, 신호게이트웨이)등이 있다.
Gateway(게이트웨이) 의미 및 역할
1. 상호변환 OSI 계층 모델의 관점에서의 게이트 웨이란 전송계층 이상에서 동작하며 SNA, DECnet, X.25등의 서로 다른 프로토콜을 사용하는 망 간에 상호연결을 할 때 사용하며, 착신 입력된 패킷을 소속 지역망의 프로토콜 형태로 변환하는 기능을 수행한다.
2. 대표성 사용자를 대표하는 유저 에이전트 관점에서 본다면, 상대측 게이트웨이는 그에 속한 사용자 집단을 대표하게 된다.
Gateway 이중화
FHRP(First Hop Redundancy Protocol)은 게이트웨이 이중화 프로토콜로 HSRP(Hot Standby Router Protocol), VRRP(Virtual Router Redundancy Protocol), GLBP(Gateway Load Balancing Protocol)등이 있으며 하나의 게이트웨이가 장애가 발생하면 다른 하나의 게이트웨이가 그 역할을 수행하도록 하는 것으로 클라이언트 입장에서는 끊김없이 외부와의 통신을 할 수 있도록 한다.
호스트 PC가 Default Router IP에 접속 못하는 상황을 대비하여 고안된 프로토콜이다. 호스트 PC에서 끊이없이 네트워크에 접속 가능하기 위해 고안된 프로토콜이다. 하나의 네트워크에 복수의 게이트웨이 사용시에, 첫번째 게이트웨이에 장애 발생시 예비 라우터가 게이트웨이로서 동작하도록 구성하거나 로드 밸런싱으로 다른 게이트웨이를 사용하도록 한다.
종류 | 설명 |
HSRP(Hot Standby Router Protoco) | CISCO 전용 프로토콜 |
VRRP(Virtual Router Router Protocol) | IEEE RFC 표준 프로토콜 |
GLBP(Gateway Load Balancing Protocol) | 백업 게이트웨이로 구현하는 것이 아닌 로드 밸런싱으로 구현하는 프로토콜 |
HSRP(Hot Standby Router Protocol)
Active Router
주 라우터, virtual router로 들어오는 트래픽을 처리한다.
Standby Router
장애애 대비안 백업 라우터, Active Router가 장애 시 Standby Router가 Active Router로 전환되어 Virtual Router로 돌아오는 트래픽을 처리한다. 해당 포트가 활성화된 상태에서 대기한다.
Virtual Router
가상 라우터로 호스트는 이것을 실제 라우터처럼 인식하며 MAC Address도 가지고 있다.
유령 라우터(Phantom Router)라고도 한다.(IP는 수동으로 준다)
Member Router
보충 라우터로 Active나 Standby Router는 아니지만 동일 HSRP 그룹에 참여하도록 하여 Active와 Standby router를 모니터링 한다. 장애 발생 시 Active 또는 Standby Router로 전환된다.
Active 라우터 선출
1) HSRP 우선 순위 지정
우선 순위 값이 높은 라우터(범위 0~255에서 지정 가능, 기본 값: 100) 높은 우선순위 일수록 Active라우터(주 게이트웨이)로 지정됨
2) 우선 순위가 동일할 경우 Gateway를 수행하는 인터페이스 IP가 높은 라우터
3) Virtual Router는 Active 라우터에서 동작한다.
4) 만약, Active Router에 장애가 발생하면 Standby Router가 Virtual Router를 인계하여 Active Router가 된다.
HSRP 동작 시 인터페이스 상태 변화
1) Initial
HSRP 미 동작
2) Learn
헬로 교환 진행, Virtual Router 미정의
3) Listen
헬로 완료 및 주기적 교환, Virtual Router 정의
4) speak
헬로 주기적 교환, Virtual Router 정의, 엑티브와 스탠바이 비교 중
5) Standby
헬로 주기적 교환, 스탠바이(백업 게이트웨이) 선출
6) Active
헬로 주기적 교환, 엑티브(주 게이트웨시) 선출(HSRP 그룹 내 엑티브는 오직 하나)
VRRP(Virtual Router Redundancy Protocol)
VRRP는 IBM에서 개발한 게이트웨이 이중화 솔루션이다. Single Virtual Router방식이고 물리 인터페이스에 설정하게 되어서 가상 버추얼 그룹을 하나밖에 만들지 못한다.(VLAN에 설정하면 여려개의 그룹을 생성하여 사용한다)
주 라우터를 master, 예비 라우터를 backup 라우터라고 한다. 라우터 선출은 우선순위를 기준으로 설정하고 기본 값은 100으로 설정이 되어 있다.
GLBP(Gateway Load Balancing Protocol)
GLBP는 시스코에서 만든 독자저인 프로토콜이며 게이트웨이 ㄷ이중화에서 가장 좋은 방법이라고 볼 수 있다. 앞서 HSRP, VRRP와는 달리 디폴트로 로드밸런싱을 지원하여 우터의 유후상태를 방지할 수 있다.(하나의 가상라우터에 MAC주소가 4개 생성된다)
GLBP의 속한 하나의 그룹의 라우터들을 AVF 라우터(데이터를 전송하는 담당)라고 하며 그 중에서 우선순위가 높은 라우터는 AVG라우터라고 한다. AVG라우터는 각 AVF 라우터들에게 가상 MAC 주소를 할당 해주고 게이트웨이의 대한 ARP 요청 응답을 한다.
weighted 설정으로도 로드 밸런싱을 설정 할 수 있지만 디폴트인 round-robin을 하고 있다.
실습
PC1 10.10.10.1/24 GW 10.10.10.254
PC2 10.10.10.2/24 GW 10.10.10.254
설정
SW1
conf t vlan 10 int f1/1 sw a vlan 10 no sh exit int f1/2 sw a vlan 10 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit int f1/10 sw m t sw t encap dot1q no sh exit |
ESW2
conf t int f1/12 no sw ip add 100.10.1.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.100 255.255.255.0 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit spanning-tree vlan 10 priority 4096 //Root bridge로 변경 int vlan 10 standby 1 ip 10.10.10.254 standby 1 priority 110 ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 100.10.1.0 0.0.0.3 area 0 |
ESW3
conf t int f1/14 no sw ip add 100.10.2.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.200 255.255.255.0 no sh exit int f1/10 sw m t sw t encap dot1q no sh exit int vlan 10 standby 1 ip 10.10.10.254 ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 100.10.2.0 0.0.0.3 area 0 |
ESW4
conf t int lo 0 ip add 1.1.1.1 255.255.255.252 exit int f1/12 no sw ip add 100.10.1.2 255.255.255.252 no sh exit int f1/14 no sw ip add 100.10.2.2 255.255.255.252 no sh exit ip routing router ospf 1 network 1.1.1.0 0.0.0.3 area 0 network 100.10.1.0 0.0.0.3 area 0 network 100.10.2.0 0.0.0.3 area 0 |
Root bridge 확인
SW1
ESW2
변경 후
ESW3
통신 확인
f1/14에 장애가 생겼을 시
통신 확인
1번문제 단점
active 라우터만 사용하기 때문에 active스위치인 SW2에 부하가 가게 되고 SW3는 쓰여지지 않아 효율성이 떨어진다.
2번
PC1 10.10.10.1/24 GW 10.10.10.254
PC2 10.10.10.2/24 GW 10.10.10.254
SW1
conf t vlan 10 int f1/1 sw a vlan 10 no sh exit int f1/2 sw a vlan 10 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit int f1/10 sw m t sw t encap dot1q no sh exit |
ESW2
conf t int f1/12 no sw ip add 100.10.1.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.100 255.255.255.0 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit spanning-tree vlan 10 priority 4096 int vlan 10 standby 1 ip 10.10.10.253 standby 1 priority 110 standby 1 preempt standby 2 ip 10.10.10.254 standby 2 priority 110 standby 2 preempt ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 100.10.1.0 0.0.0.3 area 0 |
ESW3
conf t int f1/14 no sw ip add 100.10.2.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.200 255.255.255.0 no sh exit int f1/10 sw m t sw t encap dot1q no sh exit int vlan 10 standby 1 ip 10.10.10.253 standby 1 priority 100 standby 1 preempt standby 2 ip 10.10.10.254 standby 2 priority 100 standby 2 preempt ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 100.10.2.0 0.0.0.3 area 0 |
ESW4
conf t int lo 0 ip add 1.1.1.1 255.255.255.252 exit int f1/12 no sw ip add 100.10.1.2 255.255.255.252 no sh exit int f1/14 no sw ip add 100.10.2.2 255.255.255.252 no sh exit ip routing router ospf 1 network 1.1.1.0 0.0.0.3 area 0 network 100.10.1.0 0.0.0.3 area 0 network 100.10.2.0 0.0.0.3 area 0 |
Root bridge
SW1
ESW2
변경 후
ESW3
통신 확인
vlan 10번 장애 발생 시
통신 확인
2번문제 단점
게이트웨이를 하나하나 다 지정해야 한다.
3번
PC1 10.10.10.1/24 GW 10.10.10.254
PC2 10.10.10.2/24 GW 10.10.10.254
SW1
conf t vlan 10 vlan 20 int f1/1 sw a vlan 10 no sh exit int f1/2 sw a vlan 20 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit int f1/10 sw m t sw t encap dot1q no sh exit |
ESW2
conf t int f1/12 no sw ip add 100.10.1.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.100 255.255.255.0 no sh exit vlan 20 int vlan 20 ip add 10.10.20.100 255.255.255.0 no sh exit int f1/14 sw m t sw t encap dot1q no sh exit spanning-tree vlan 10 priority 4096 int vlan 10 standby 1 ip 10.10.10.254 standby 1 priority 110 standby 1 preempt exit int vlan 20 standby 2 ip 10.10.20.254 standby 2 priority 100 standby 2 preempt ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 10.10.20.0 0.0.0.255 area 0 network 100.10.1.0 0.0.0.3 area 0 |
ESW3
conf t int f1/14 no sw ip add 100.10.2.1 255.255.255.252 no sh exit vlan 10 int vlan 10 ip add 10.10.10.200 255.255.255.0 no sh exit vlan 20 int vlan 20 ip add 10.10.20.200 255.255.255.0 no sh exit int f1/10 sw m t sw t encap dot1q no sh exit spanning-tree vlan 20 priority 4096 int vlan 10 standby 1 ip 10.10.10.254 standby 1 priority 100 standby 1 preempt exit int vlan 20 standby 2 ip 10.10.20.254 standby 2 priority 110 standby 2 preempt ip routing router ospf 1 network 10.10.10.0 0.0.0.255 area 0 network 10.10.20.0 0.0.0.255 area 0 network 100.10.2.0 0.0.0.3 area 0 |
ESW4
conf t int lo 0 ip add 1.1.1.1 255.255.255.252 exit int f1/12 no sw ip add 100.10.1.2 255.255.255.252 no sh exit int f1/14 no sw ip add 100.10.2.2 255.255.255.252 no sh exit ip routing router ospf 1 network 1.1.1.0 0.0.0.3 area 0 network 100.10.1.0 0.0.0.3 area 0 network 100.10.2.0 0.0.0.3 area 0 |
Root bridge
SW1
ESW2
ESW3
통신확인
3번 문제 단점
트래픽이 많아진다
'Network' 카테고리의 다른 글
OSI 7Layer(7계층) 4~7계층 (0) | 2022.06.28 |
---|---|
OSI 7Layer(7계층) 1~4계층 (0) | 2022.06.28 |
NAT (0) | 2022.06.16 |