bxm's IT Story
ASA Series1 - 가상화 본문
## 10 네트워크에 방화벽 1개, 20 네트워크에 방화벽이 1개가 붙었는데 이것이 가상화가 된 것이다.
## ASA 가상화를 할 것인데 1개를 가져다가 2개로 쓸 것임.
1) Admin context라는 특수한 가상 Device가 필요함. (총 3개의 가상 Device가 필요함)
2) Sub interface 나눌 때와 같이 편하게 생각하면 된다.
3) 이렇게 하면 비용도 절감되고, 능률도 생긴다.
## Security-Context ##
- 하나의 물리적 방화벽 장비를 다수의 논리적 방화벽으로 나눠서 사용하는 것을 의미한ㄷ.
- 방화벽의 모델과 라이센스에 따라서 사용할 수 있는 가상 방화벽의 숫자가 다르다. (라이센스에 따라 다르다는 것임.)
0~255개의 가상 방화벽을 구축할 수 있다.
- 각각의 논리적 방화벽은 여기서 Context라고 부르고, 물리적 방화벽은 System이라고 한다. 논리적 방화벽은 서로
독립된 장비처럼 동작하고, 다른 Context에게 영향을 주지 않는다.
## Security-Context 사용 목적은 다음과 같다.
1) 하나의 방화벽 장비를 다수의 고객 혹은 조직이 공유하면서 각각 다른 보안 정책을 구성하는 경우.
2) 방화벽 이중화 구성시 Active/Active(잘못 쓴 것 아님. Active/Active 맞음.) 방식으로 구성하는 경우.
## Security-Context를 사용할 경우, 다음과 같은 제한을 가지고 있다.
1) Dynamic Routing Protocol을 지원하지 않는다.
2) VPN을 지원하지 않는다.
3) Multicast를 지원하지 않는다.
## Security-context 사용 여부는 [show mode] 명령어로 확인이 가능하다.
1) single mode : Security-Context 사용 XX
2) multiple mode : Security-Context 사용 OO
공통]
conf t
no ip domain lookup
line c 0
logg sy
exec-timeout 0
exit
line vty 0 4
pass cisco
end
wr
ASA]
conf t
clear configure all ## 기존에 사용하던 ASA 이므로 위의 명령어를 통해서 전부 날리기.
hostname ASA
show mode
mode multiple
show mode
show run ## 아까 clear configure all을 통해서 다 날렸기에 다 지워진 것도 확인.
enable password cisco123
int g 1
no shut
exit
int g 0
no shut
exit
## 이렇게 no shut까지만 해놓은 다음에 Sub Interface를 나눠보자.
int g 0.10
vlan 10
exit
int g 0.20
vlan 20
exit
## 논리적인 Context를 만들고, C1-ASA의 인터페이스는 아래의 2개라고 선언을 해줌.
## Configure 파일을 저장을 할 것인데 C1-ASA.cfg에 저장을 할 것이다.
context C1-ASA
allocate-interface g1
allocate-interface g0.10
config-url C1-ASA.cfg
exit
## 논리적인 Context를 만들고, C1-ASA의 인터페이스는 아래의 2개라고 선언을 해줌.
## Configure 파일을 저장을 할 것인데 C1-ASA.cfg에 저장을 할 것이다.
context C2-ASA
allocate-interface g1
allocate-interface g0.20
config-url C2-ASA.cfg
exit
show context
- 현재 방화벽에 존재하는 논리적 방화벽(Context)를 확인할 수 있다. 'Admin Context'의 경우 관리자가 별도로
생성하지 않아도 기본적으로 존재한다.
- 만약 'Admin Context'가 확인되지 않는 경우 다음과 같이 관리자가 수동으로 생성해야 한다.
admin-context admin
context admin
config-url admin.cfg
exit
## 이제 각 Context를 이동하면서 독립적인 정책을 설정할 수 있다.
changeto context C1-ASA
changeto context C2-ASA
changeto system ## --> Admin으로 들어가는 방법.
## 첫번째, C1-ASA로 가서 설정.
changeto context C1-ASA
int g 1
desc ##Outside_NET##
ip add 1.1.100.1 255.255.255.248
nameif Outside
security-level 0
mac-address 0001.0001.0001
exit
int g 0.10
desc ##Inside_NET_VLAN10##
ip add 10.10.10.254 255.255.255.0
nameif Inside
security-level 100
exit
## 모르는 것은 1.1.100.3으로 가게하면 된다.
route Outside 0 0 1.1.100.3
## Ping Test 허용. (현업에서는 이렇게 하면 안된다. 실습을 용이하게 하기 위해서 하는 것임 ㅎㅎ)
'Show run' 에서 policy-map ~ class 까지 긁어오고 inspect icmp 추가.
policy-map global_policy
class inspection_default
inspect icmp
exit
exit
## NAT 돌리기
object network VLAN10_IN
subnet 10.10.10.0 255.255.255.0
nat (Inside,Outside) dynamic interface
exit
## 두번째, C2-ASA로 가서 설정. (C1-ASA와 똑같이 하면 되므로 사진은 생략)
changeto context C2-ASA
int g1
desc ##Outside_NET##
ip add 1.1.100.2 255.255.255.248
nameif Outside
security-level 0
mac-address 0002.0002.0002
exit
int g 0.20
desc ##Inside_NET_VLAN20##
ip add 10.10.20.254 255.255.255.0
nameif Inside
security-level 100
exit
## 모르는 것은 1.1.100.3으로 가게하면 된다.
route Outside 0 0 1.1.100.3
## Ping Test 허용.
policy-map global_policy
class inspection_default
inspect icmp
exit
exit
## NAT 돌리기
object network VLAN20_IN
subnet 10.10.20.0 255.255.255.0
nat (Inside,Outside) dynamic interface
exit

CE] - ASA에서 이미 NAT를 해줬기 때문에 해줄 필요가 없다!!!
스포일러이지만... NAT 설정을 다시 해줘야 한다 ㅎㅎㅎ... 아래에 또 적어놨음.
conf t
## 기존의 설정 지우기.
no ip route 211.100.1.1 255.255.255.255 FastEthernet0/0 1.1.100.3
int f0/0
no shut
ip add 1.1.100.3 255.255.255.248
ip nat inside
exit
int f1/0
no shut
ip add 2.2.2.254 255.255.255.0
ip nat inside
exit
int f0/1
no shut
mac-address 006e.0305.02a0
ip add dhcp
ip nat outside
exit
ip access-list standrade INGRESS
permit 1.1.100.0 0.0.0.7
exit
ip route 0.0.0.0 0.0.0.0 f0/1 10.0.0.1
end
wr
ping 10.0.0.1
ASA]
changeto context C1-ASA
ping 10.0.0.1
SW1]
conf t
no ip routing
int f1/1
no sw acc vlan 10
no sw mode access
end
show vlan-sw
ASA - C1 ASA]
ping 1.1.100.3
traceroute 10.0.0.1
## T는 1.1.100.3 까지만 가고 그 다음부터 안감.
CE] - 바깥에서 1.1.100.1/29를 모르기 때문에 못돌아오는 것 같다.
conf t
ip access-list standard INGRESS
permit 1.1.100.0 0.0.0.7
exit
ip nat inside source list INGRESS int f0/1 overload
int f0/0
ip nat inside
exit
int f0/1
ip nat outside
exit
int f1/0
ip nat inside
end
wr
ASA - C1 ASA]
traceroute 10.0.0.1
## Server 붙이기 전에 VLAN 넣어주기. ##
SW2]
conf t
vlan 10
exit
vlan 20
exit
int f1/0
sw mo ac
sw ac vlan 10
exit
int f1/1
sw mo ac
sw ac vlan 20
exit
int f1/15
sw tr enc dot
sw mo tr
end
wr
SW3]
conf t
vlan 10
exit
int range f1/1 , f1/15
sw mo ac
sw ac vlan 10
end
wr
SW4]
conf t
vlan 20
exit
int range f1/2 , f1/15
sw mo ac
sw ac vlan 20
end
wr
Win701] - 10.10.10.1 // VMNet 1
ping 10.0.0.1
ping 168.126.63.1
www.naver.com
Win702] - 10.10.20.2 // VMNet 2
ping 10.0.0.1
ping 168.126.63.1
www.naver.com
## 만약 뭔가 문제가 생겼다면,
1) CE에서 NAT 다시 한번 확인해보기. (1.1.100.0 0.0.0.7 허용)
2) ASA Context 제대로 만들어졌는지 확인해보기.
3) IP와 Up 되어있는지 다시 한번 확인해보기.



## Server 달고 각 Context별 방화벽 정책 설정 ##
## 기존의 GNS3 파일[Security Context]을 저장하고, 다른 이름[]으로 저장
CE] - 이제 Server가 50.1.1.x로 나타날 것임. 아래 ASA에서의 NAT 설정!!
conf t
ip route 50.1.1.1 255.255.255.255 f0/0 1.1.100.1
ip route 50.1.1.2 255.255.255.255 f0/0 1.1.100.2
ASA]
## CentOS (FTP Server 설정)
changeto context C1-ASA
object network FTP_SVR
host 10.10.10.100
nat (Inside,Outside) static 50.1.1.1
exit
access-list OUT->IN permit tcp any host 10.10.10.100 eq 21
access-list OUT->IN deny ip any any log 4 interval 60
access-group OUT->IN in interface Outside
## Win2016 (DNS, WEB Server 설정)
changeto context C2-ASA
object network DNS_SVR
host 10.10.20.100
nat (Inside,Outside) static 50.1.1.2 service udp 53 53
exit
object network WEB_SVR
host 10.10.20.100
nat (Inside,Outside) static 50.1.1.2 service tcp 80 80
exit
## DNS_Rewirte
## 외부_Kali같은 것에서 Win2016으로 질의를 하면, 10.10.20.100을 못찾아감. 50 대역밖에 인식을 모름.
그래서 10.10.20.100 대역을 50.1.1.2로 알려주는 것임.
object network DNS_RE
host 10.10.20.100
nat (Inside,Outside) static 50.1.1.2 dns
exit
access-list OUT->IN permit udp any host 10.10.20.100 eq 53
access-list OUT->IN permit tcp any host 10.10.20.2 eq 80
access-list OUT->IN deny ip any any log 4 interval 60
access-group OUT->IN in interface Outside
end
wr
## Server 세팅 ##
CentOS] - 10.10.10.100 // VMNet 3
vi /etc/sysconfig/network-scripts/ifcfg-ens32
systemctl restart network
ping 10.10.10.254
SW3]
conf t
int range f1/2 - 3
no shut
sw mo ac
sw ac vlan 10
end
wr
SW4]
conf t
int f1/1
no shut
sw mo ac
sw ac vlan 20
end
wr
R1]
conf t
int f0/0
no shut
ip add 10.10.10.2 255.255.255.0
end
ping 10.10.10.254
## CentOS와 Win701에서 게이트웨이인 10.10.10.254로 맨 처음 Ping이 안갔었음.
## 이유는 SW3에서 [show ip int br]을 해본 결과, f1/2와 f1/3의 Protocol이 'Down' 상태였음 ㅋㅋ..
## int range f1/2 - 3 에서 shut -> no shut 해주면 돌아오고 Ping도 잘 간다.
CentOS]
firewall -config
rpm -qa | grep vsftpd
systemctl start vsftpd.service
systemctl enable vsftpd.service
vi /etc/vsftpd/vsftpd.conf
Win701]
[알드라이브] - [10.10.10.100] - 접속 된다.
SW4]
show ip int br
conf t
int f1/1
shut
no shut
end
show ip int br
wr
Win2016] - 10.10.20.100 // VMNet 5
ping 10.10.20.254
Today 끝!!

## Server 설정 ##
Win2016]
[검색] - dnsmgmt.msc
## 정방향 설정
## 역방향 설정
## Web Server 설정 ##
Win2016]
[서버 관리자]
## Server 까지 설치 및 설정 완료하였음.
## Admin Context 구성 ##
- 특정 Context에 Telnet, SSH 등의 원격 접근을 허락할 경우 해당 Context 안에서만 작업이 가능하고, 다른 Context로
이동이 불가능하다.
- 방화벽 관리자가 전체 Context를 관리하기 위해서는 모든 Context로 이동이 가능해야 한다. 이를 가능하게 해주는
유일한 Context가 Admin Context이다.
ASA]
changeto system
int g 0.30
vlan 30
exit
context admin
allocate-interface g0.30
exit
changeto context admin
int g 0.30
desc ##Management_Network##
ip add 192.168.1.254 255.255.255.0
nameif Management
security-level 100
management-only
exit
telnet 192.168.1.1 255.255.255.255 Management
password cisco123
show context
## Kali에서 인터넷 되는지 확인 ##
CE]
## Access-list 추가 (Kali에 대한 NAT 허용)
conf t
ip access-list standard INGRESS
20 permit 2.2.2.0 0.0.0.255
end
wr
ASA]
changeto context C2-ASA
access-list OUT->IN line 1 permit icmp any any echo
show access-list
object network DNS_SVR_TEST2
host 10.10.20.100
nat (Inside,Outside) static 50.1.1.2
Kali] - 2.2.2.1 // VMNet 9
vi /etc/network/interfaces
service networking restart
init 6
ifconfig
vi /etc/resolv.conf
## 만약 인터넷이 안된다!?
1) CE에서 10.0.0.1로 Ping Test ==> 된다? 그러면 NAT 문제임.
2) CE에서 NAT Inside, Outside 제대로 되었는지 다시 한번 확인. 나는 1/0 포트에 Outside로 줘서 Kali가 10.0.0.1을
아예 못잡았음.
## Win10에서 Telnet으로 ASA를 조종할 수 있는지 확인 ##
SW2]
conf t
vlan 30
exit
int f1/2
sw mo ac
sw ac vlan 30
exit
int f1/2
shut
no shut
end
wr
Win10] - Win10이 따로 없어 Clone-Win701로 대체
192.168.1.1 // VMNet 4
## telnet 접속
끝!!

'Network > Firewall (KEDU)' 카테고리의 다른 글
ASA Series2.(2,Final) - 이중화(Active/Active Failover) (0) | 2021.09.07 |
---|---|
ASA Series2.(1) - 이중화(Active/Standby Failover) (0) | 2021.09.07 |
ASA Transparent Mode (3) | 2021.09.06 |
Access-list (Final Version - Numbers, Names) (0) | 2021.08.17 |
ASA Policy (0) | 2021.08.02 |