UTM DNAT
Cisco Static NAT
Reverse NAT
L2 Mode ≒ Switch Mode (위아래를 같은 네트워크 대역으로 설정하라)
≒ Transparent Mode
보안에 취약하나 속도는 빠르다
L3 Mode ≒ Route Mode
L4 Switch = Load Balancer
NAT Mode : 보안에 좋으나 속도 느림
UTM과 WAF는 위와 같은 기능을 가지고 있다
L4 Switch는 로드밸런스의 기능을 갖고 있어서?
원래 외부에서 웹사이트를 접속하려 할 때 Static NAT를 걸어줬어야했다
근데 로드밸런스로 설정하면 분할되어있기 때문에 Static NAT를 걸어주지 않아도 L4 스위치가 Switching 해준다
L4 Switch 설치된 거 불러들이기
번외) 리눅스 클론만들어서 혹은 기존에 있던 파일 Open해서 쓰게 되면 MAC Address 충돌될 수 있어서
VM - Settings
Power On 하고
PW: admin
>>main# .
📌로드밸런싱이랑 헬스체크 꼭 기억할 것
Health Check
접속자가 많으면
1. L4 Switch 모든 포트를 VLAN1으로 설정
초기 값: 모든 포트는 별도의 VLAN으로 구성되어 있다
# /info/l2/vlan → 초기 정보 확인
Port 2, Port 3번을 VLAN 1번으로 설정
# /cfg/l2/vlan 1
# add 2
y
# add 3
y
# apply → 적용
# /info/l2/vlan → 변경 정보 확인(vlan 1에 1-3번 port 확인)
#/info/l2/vlan

/cfg/l2/vlan 1
# add 2
Confirm changing PVID from 2 th 1 [y/n]: y
# add 3
y

# apply
# /info/l2/vlan

#
2. L4 스위치 IP 주소 설정
VLAN 별 가상인터페이스 생성 (if 1) 후 설정
# /cfg/l3/if 1
# addr [10.𝒙.140.50]/mask 255.0.0.0/ena
→ # addr 10.130.140.50/mask 255.0.0.0/ena
# apply
# cur → 확인
3. L4 스위치 Gateway 설정
- Gateway 설정을 통해 외부망과 통신 가능하도록 구성
# /cfg/l3/gw 1
# addr 10.0.0.1/ena
# apply
# ping 8.8.8.8
ping 테스트
4. L4 Switch Load Balancing 설정
① slb 설정 (Server Load Balancing)
② Real Server 설정
③ Real Server 그룹 설정
④ 가상 IP 주소 설정
⑤ 서비스 종류 및 적용 그룹 설정
⑥ 클라이언트 / 서버 포트 지정
# /cfg/slb → 로드밸런싱 설정 진입
Real 서버 설정
# real 1/rip 10.130.140.1/ena
# ../real 2/rip 10.130.140.2/ena
# apply
Real 서버 그룹 설정
# /cfg/slb
# group 1/add 1/add 2
# metric roundrobin → 로드밸런싱 방식 지정
# health http → 헬스 체크 방식 지정
가상 IP 주소 설정
# /cfg/slb
# virt 1/vip 10.130.140.100/ena --> 외부에서 접속할 Web서버 IP주소 역할
서비스 종류 및 적용 그룹 설정
# service http/group 1
# apply클라이언트 / 서버 포트 지정> 클라이언트 포트 : 라우터와 연결된 포트(요청 받을 포트)> 서버 포트 : Real Server와 연결된 포트==> 각 포트 별 별도 역할을 지정해주어야 안정적으로 작동# /cfg/slb# port 1/client enable/server disable# ../port 2/client disable/server enable# ../port 3/client disable/server enable# apply
# /cfg/slb → 로드밸런싱 설정 진입
4-2. Real Server 설정
real 1/rip [서버 1 IP 주소]/ena
# real 1/rip 10.130.140.1/ena
.. real 2/rip [서버2 IP 주소]/ena
# ../real 2/rip 10.130.140.2/ena

# apply

#
4-3. Real Server Group 설정
# /cfg/slb
# group 1/add 1/add 2
# metric roundrobin
# health http
4-4. 가상 IP 주소 설정
# /cfg/slb
# virt 1/vip 10.130.140.100/ena → 외부에서 접속할 WEB server IP 주소 역할
4-5. 서비스 종류 및 적용 그룹 설정
# service http/group 1
# apply
5. SLB 기능 활성화
VRRP
(Virtual Router Redundancy Protocol)
Gateway 이중화
국가는 AS#
대형 ISP AS#
RIP, OSPF, IS-IS
AS #(Number)가 다를 때 연결은 BGP(Border Gateway Procotol)을 사용해서 연결한다
게이트웨이 이중화가 필요한 이유?
PC와 서버와 같은 말단 단말기는 라우팅 기능이 없어 동적 라우팅 프로토콜을 설정할 수 없다. 따라서 기본 게이트웨이
장애 시 이를 인지할 수 없으며 외부 네트워크와 통신할 수 없게 된다. (단일 장애 지점이 됨)
그러나 2대의 장비를 운영하여 하나의 게이트웨이 장비가 Down 될 시, 다른 장비가 게이트웨이로 동작할 수 있도록 한다면 네트워크 단절없이 통신을 지속할 수 있을 것이다.
이를 게이트웨이 이중화라고 하며, 2대의 게이트웨이 역할을 하는 장비 간 이중화에 사용되는 프로토콜이 FHRP이다.
(스위치, 방화벽, NAC에서도 사용가능)
평소에는 Router1을 주로 사용하다가 부하가 걸리면 Router 2가 진행한다
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa1/0
R1(config-if)#no shutdown
R1(config-if)#ip add
*Mar 1 00:04:02.967: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state t
*Mar 1 00:04:03.967: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthern
R1(config-if)#ip add 10.10.10.10 255.255.255.0
R1(config-if)#vrrp 1 ip 10.10.10.254
R1(config-if)#
*Mar 1 00:05:09.399: %VRRP-6-STATECHANGE: Fa1/0 Grp 1 state Init -> Backup
R1(config-if)#vrrp 1 p
*Mar 1 00:05:13.011: %VRRP-6-STATECHANGE: Fa1/0 Grp 1 state Backup -> Master
R1(config-if)#vrrp 1 priority 120
R1(config-if)#vrrp 1 timer advertise 5
R1(config-if)#vrrp 1 timer learn
R1(config-if)#vrrp 1 preempt delay minimum 5
R1(config-if)#exit
R1(config)#track 1 interface fa1/0 line-protocol
R1(config-track)#vrrp 1 track 1 decrement 30
R1(config-track)#exit
R1(config)#int fa1/0
R1(config-if)#vrrp 1 track 1 decrement 30
R1(config-if)#end
R1#
R1#show vrrp all
FastEthernet1/0 - Group 1
State is Master
Virtual IP address is 10.10.10.254
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 5.000 sec
Preemption enabled, delay min 5 secs
Priority is 120
Track object 1 state Up decrement 30
Master Router is 10.10.10.10 (local), priority is 120
Master Advertisement interval is 5.000 sec
Master Down interval is 15.531 sec
R1#show vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa1/0 1 120 15531 Y Master 10.10.10.10 10.10.10.254
R1#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int fa1/0
R2(config-if)#no shut
R2(config-if)#ip add 10.10
*Mar 1 00:07:41.103: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Mar 1 00:07:42.103: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R2(config-if)#ip add 10.10.10.20 255.255.255.0
R2(config-if)#vrrp 1 ip 10.10.10.254
R2(config-if)#vrrp
*Mar 1 00:07:54.035: %VRRP-6-STATECHANGE: Fa1/0 Grp 1 state Init -> Backup
R2(config-if)#vrrp 1 pri
*Mar 1 00:07:57.647: %VRRP-6-STATECHANGE: Fa1/0 Grp 1 state Backup -> Master
R2(config-if)#vrrp 1 priority 100
R2(config-if)#vrrp 1 timer advertise 5
R2(config-if)#vrrp 1 timer learn
R2(config-if)#
R2(config-if)#
R2(config-if)#
R2(config-if)#end
R2#wr
Building configuration...
[OK]
R2#
*Mar 1 00:08:22.091: %SYS-5-CONFIG_I: Configured from console by console
R2#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
R2#show vrrp all
FastEthernet1/0 - Group 1
State is Master
Virtual IP address is 10.10.10.254
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 5.000 sec
Preemption enabled
Priority is 100
Master Router is 10.10.10.20 (local), priority is 100
Master Advertisement interval is 5.000 sec
Master Down interval is 15.609 sec
R2#show vrrp brief
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa1/0 1 100 15609 Y Master 10.10.10.20 10.10.10.254
R2#
'☁︎클라우드 > 일자별' 카테고리의 다른 글
240321 DAY 51~65 : Project I - 기술보고서 1 (0) | 2024.04.15 |
---|---|
240320 DAY 50 (0) | 2024.03.21 |
240315 DAY 47 (0) | 2024.03.17 |
240314 DAY 46 (0) | 2024.03.15 |
240313 DAY 45 (0) | 2024.03.14 |