asav971-4.qcow2는 KVM 원본 파일이다.
ASA파일을 누르자
CiscoASA
layer2방화벽, layer3방화벽 둘다 가지고 있기 때문에
no firewall transparent //3계층 방화벽으로 되돌리기
show
asa는 인터페이스에 이름이 부여되지않으면 주인터페이스를 쓸 수 없다.
(가장 큰 차이점)
asa를 쓰고싶으면
이 상태로는 인터페이스에 이름이 없기때문에 no shut할 수 없다.
Inside를 선언하면 자동으로 100이 매겨진다.(Inside의 security level default 값 = 100)
보안레벨이 높을수록 쎈놈이다.
UTM이나 firewall에서는 모든 정책을 인위적으로 줬는데 ASA는 사람이 손댈 필요가 없다.
숫자만 주면 높은곳에서 낮은숫자로 흐른다. (알아서 정책을 준다는 뜻임)
하지만 낮은곳에서 높은곳으로는 못뛴다.
security level로만으로 다 해결할 수는 없고 관리자가 손대야할 부분도 있지만 UTM이나 다른것보다 관리가 훨씬 편하다.
description(주석)도 줄 수 있다.
ciscoasa(config)# int g0/0
ciscoasa(config-if)# no shut
ciscoasa(config-if)# nameif Inside
INFO: Security level for "Inside" set to 100 by default.
ciscoasa(config-if)# desc
ciscoasa(config-if)# description ##Inside_Network##
ciscoasa(config-if)# ip address 200.1.1.254 255.255.255.0
ciscoasa(config-if)# security-level 100
ciscoasa(config-if)# exit
ciscoasa(config)# int g0/1
ciscoasa(config-if)# no shut
ciscoasa(config-if)# nameif Outside
INFO: Security level for "Outside" set to 0 by default.
ciscoasa(config-if)# security-level 0
ciscoasa(config-if)# ip add 1.1.100.1 255.255.255.252
ciscoasa(config-if)# desc ##Outiside_Network##
DMZ는 Inside와 Outside레벨의 딱 절반이면 된다.
default로 security level이 0이 되지만 관리자가 개입해서 50으로 만들어준다.
ciscoasa(config-if)# int g0/2
ciscoasa(config-if)# no shut
ciscoasa(config-if)# nameif DMZ
INFO: Security level for "DMZ" set to 0 by default.
ciscoasa(config-if)# security-level 50
ciscoasa(config-if)# desc ##DMZ##
ciscoasa(config-if)# ip add 100.1.1.254 255.255.255.0
ISP>>
no swi(아... 얘땜에 dhcp안받아와진것같음)
int f0/1
no shut
ip add dhcp
int f1/0
no shut
ip add 2.2.2.254 255.255.255.0
int f0/0
no shut
ip add 1.1.100.6 255.255.255.252
CE>>
int f0/1
no shut
ip add 1.1.100.5 255
ip add 1.1.100.5 255.255.255.252
int f0/0
ip add 1.1.100.2 255.255.255.252
DWS>>
no ip routing
int f0/0
no shut
ip add 200.
ip add 200.1.1.2 255.255.255.0
DMZ-SW>>
no ip routing
이웃끼리 핑
라우팅
ISP(config-if)#ip route 0.0.0.0 0.0.0.0 f0/1 10.0.0.1
ISP(config)#ip route 1.1.100.0 255.255.255.252 f0/0 1.1.100.5
ISP(config)#ip route 100.1.1.0 255.255.255.0 f0/0 1.1.100.5
ISP(config)#ip route 200.1.1.0 255.255.255.0 f0/0 1.1.100.5
NAT돌리기
DMZ에서는 리쿼시브쿼리 받아와야한다.
ISP(config)#ip access-list standard DMZ_Inside
ISP(config-std-nacl)#permit 100.1.1.0 0.0.0.255
ISP(config-std-nacl)#permit 200.1.1.0 0.0.0.255
ISP(config-std-nacl)#permit 2.2.2.2 0.0.0.0
ISP(config-std-nacl)#permit 1.1.100.0 0.0.0.3
ISP(config-std-nacl)# ip nat inside source list DMZ_Inside interface f0/1 overload
ISP(config-if)#int range f1/0 , f0/0
ISP(config-if-range)#ip nat inside
ISP(config-if-range)#int f0/1
ISP(config-if)#ip nat outside
CE(config-if)#ip route 0.0.0.0 0.0.0.0 f0/1 1.1.100.6
CE(config)#ip route 100.1.1.0 255.255.255.0 f0/0 1.1.100.1
CE(config)#ip route 200.1.1.0 255.255.255.0 f0/0 1.1.100.1
DWS(config)#ip routing
DWS(config-if)#ip route 0.0.0.0 0.0.0.0 f0/0 200.1.1.254
DWS(config)#do ping 1.1.100.2 //당연히 통과 못 시킴
일시적으로 방화벽에서 핑을 풀어서 핑되게 해줘본다.
ciscoasa# show run
policy-map global_policy
ASA가 기본적으로 허용하는 정책이 여기에 모여있다.
policy-map global_policy
class inspection_default
inspect icmp
ping 1.1.100.2 해주면 안되던게 된다.
ciscoasa(config)# show int ip br //명령어 다른거 확인
ciscoasa(config)# route Outside 0 0 1.1.100.2 //0 0 이 0.0.0.0 0.0.0.0이다.
DWS(config)#do ping 10.0.0.1 해보면 핑 날아간다.
서버 구축
telnet 허용하기
DWS#telnet 200.1.1.254
Trying 200.1.1.254 ...
% Connection timed out; remote host not responding
DWS#ping 200.1.1.254
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms
여기에 telnet이 안보임
telnet 200.1.1.0 255.255.255.0 Inside
password cisco
DSW에서 telnet 200.1.1.254 해보면 telnet성공
ciscoasa(config)# telnet 100.1.1.0 255.255.255.0 DMZ
CentOS>>
DMZ-SW(config)#ip default-gateway 100.1.1.254
ASA에서 Outside쪽 telnet 허용해주기
CE에서 telnet연결해주지만 안된다.
왜? security level이 더 낮기 때문
//username password로 접근하도록 하는것.
ASA는 와일드카드를 서브넷처럼 표현한다.
Win701에서 ssh접근 가능
CE에서 ssh연결 시도해보니까 된다!
여기서 알수있는점 : ssh 는 security level이 낮은쪽에서도 허용이 된다!
지금까지 해본것을
GUI 로 해보자
Cisco
GUI로 Management한다는것
ASA의 후레쉬메모리에 리눅스 NS이미지?를 넣어야한다.
TFTP운영체제로 심겠다.
asdm-781-150.bin 은 운영체제 이미지 파일이다.
ASA>>
clear로 모두 다 초기화시켜주고
ssh를 Management에 허용
server는 준비 끝!
ASA가 client가 된다.
이제 client세팅을 해보자.
서버 ip는 192.168.1.1
파일명은 asdm-781-150.bin
dir /all
flesh memory에있는 모든 파일 보여달라
자바 설치하기
GUI설치끝!
DMZ에는 출발지 any / 목적지 any less secure
Inside에는 출발지 any / 목적지 any less secure
Globla에는 출발지 any / 목적지 any
여기까지는 방화벽을 건든게 없다. 설정한게 하나도 없음...
과제]
Inside와 DMZ에서 Outside로의 접근은 Sec_level 에 의해 동작한다. Outside에서 DMZ 에서 위치한 다음 서비스들에 대해 접근을 허용하시오.
-DNS 서버(100.1.1.250)
-WEB 서버(100.1.1.251)
-ICMP(100.1.1.0/24)
참고로 ASA는 named만 있고 numbered만 있다.
순서도 좀 다름. access-list 이름 extended~~~
ASA>>
ciscoasa(config)# access-list OUT->IN extended permit udp any host 100.1.1.250 eq 53
ciscoasa(config)# access-list OUT->IN extended permit tcp any host 100.1.1.251 eq 80
ciscoasa(config)# access-list OUT->IN extended permit icmp any 100.1.1.0 255.255.255.0 //와일드카드가 서브넷처럼 바뀐다.
ciscoasa(config)# access-list OUT->IN deny ip any any
ciscoasa(config)# access-group OUT->IN in interface Outside //저 정책 4개를 Outside로 받는다.
Win702에서 새로고침 해보면
4개가 생성된 것을 확인 가능하다.
이제 이걸 지우고 GUI로 넣어보자
ACL 이름 바꾸고 싶으면,
Kali>>
100.1.1.251
Kali에서 2016 에서 dns받아오는지 확인
이것들을 다 정책으로 펼쳐보자
ciscoasa(config)# object network Sails
ciscoasa(config-network-object)# subnet 200.1.1.0 255.255.255.0
ciscoasa(config-network-object)# object network MGR
ciscoasa(config-network-object)# subnet 200.2.2.0 255.255.255.0
ciscoasa(config-network-object)# exit
ciscoasa(config)# object network DNS_SVR
ciscoasa(config-network-object)# host 100.1.1.250
ciscoasa(config-network-object)# exit
ciscoasa(config)# object network WEB_SVR
ciscoasa(config-network-object)# host 100.1.1.251
ciscoasa(config-network-object)# exit
넣고 GUI로 가보자..
ACL의 갯수를 줄여준다 = 연산속도가 빠르다.(그룹으로 묶어서 한방에 적용하기 때문에)
'네트워크 수업 > Docker' 카테고리의 다른 글
ASA 23.05.26 (0) | 2023.05.26 |
---|---|
ASA 23.05.23 (0) | 2023.05.25 |
Docker Image (0) | 2023.05.18 |
도커네트워크 23.05.16 (0) | 2023.05.16 |
zfw 23.05.15 (0) | 2023.05.15 |
댓글