root

Leader IT/Architect
Dec 31, 2012
1,153
72
48

Lab Config Virtual Firewall Cisco ASA with Non Shared Interfaces


I. Mô hình và yêu cầu lab config virtual Firewall with non shared interfaces
1. Mô hình
- Mô hình bài lab virtual firewall with non shared interfaces trên Cisco ASa sử dụng một fireall Cisco ASA 8.4 với mỗi physical interface sẽ được gán cho một Security Context

virtual firewall with non shared interfaces (1)
2. Chuẩn bị và yêu cầu
-Thiết lập thiết bị như mô hình lab config Virtual Firewall with non shared interface on Cisco ASA.
- Yêu cầu PC thuộc context LAN1 và LAN2 ping ra internet thành công
- PC trong LAN2 ping tới PC trong LAN1 thành công
- Cấp resource cho context LAN1


virtual firewall with non shared interfaces (2)

II. Triển khai lab config Virtual Firewall with non shared interfaces on Cisco ASA


1. Cấu hình trên Router
- Cấu hình IP cho Router

Code:
R1(config)#int f1/0
R1(config-if)#ip address dhcp
R1(config-if)#no shutdown

R1(config-if)#int f0/0
R1(config-if)#ip address 10.0.0.254 255.255.255.0

R1(config-if)#int f0/1
R1(config-if)#ip addrses 10.1.1.254 255.255.255.0
R1(config-if)#no shutdown
- Cấu hình Route cho các mạng LAN của các context
Code:
R1(config)#ip route 192.168.10.0 255.255.255.0 10.0.0.1
R1(config)#ip route 192.168.20.0 255.255.255.0 10.1.1.1

- Cấu hình NAT để ra internet
Code:
R1(config)#access-list 1 permit any
R1(config)#ip nat inside source list 1 interface f1/0 overload
R1(config)#int f0/0
R1(config-if)#ip nat inside
R1(config-if)#int f0/1
R1(config-if)#ip nat inside
R1(config-if)#int f1/0
R1(config-if)#ip nat outside

- Ping ra internet thành công
R1(config-if)#do ping 8.8.8.8


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/11/24 ms

2. Config Virtual Firewall on Cisco ASA

- Kiểm tra ASA có support Security-Context hay không
ciscoasa# sh version | include Security Context

Security Contexts : 5 perpetual
- Kiểm tra xem ASA đang ở mode nào
ciscoasa# sh mode
Security context mode: single
- Để cấu hình Security context các bạn cần chuyển ASA của bạn về mode "Multiple". Khi bạn đánh lệnh chuyển qua mode này thì ASA sẽ yêu cầu bạn reboot lại
ciscoasa(config)# mode multiple


WARNING: This command will change the behavior of the device
WARNING: This command will initiate a Reboot
Proceed with change mode? [confirm]
Convert the system configuration? [confirm]
!
The old running configuration file will be written to flash

Converting the configuration - this may take several minutes for a large configuration

The admin context configuration will be written to flash

The new running configuration file was written to flash
Security context mode: multiple

***
*** --- SHUTDOWN NOW ---
***
*** Message to all terminals:
***
*** change mode
REBOOT: open message queue fail: No such file or directory/2
REBOOT: enforce reboot...
Restarting system.
- Sau khi khởi động lại xong, bạn kiểm tra xem ASA đã chuyển qua mode Multiple chưa
ciscoasa# sh mode

Security context mode: multiple
3. Tạo các Security context trên Firewall Cisco ASA
- Trên ASA thực hiện tạo ra các context LAN1 và LAN2. Sau đó gán các interface của ASA vào các context tương ứng

Code:
ciscoasa(config)# context LAN1
ciscoasa(config-ctx)# allocate-interface g0 LAN1_outside
ciscoasa(config-ctx)# allocate-interface g1 LAN1_inside
ciscoasa(config-ctx)# config-url disk0:/LAN1.cfg

ciscoasa(config-ctx)# context LAN2
ciscoasa(config-ctx)# allocate-interface g2 LAN2_outside
ciscoasa(config-ctx)# allocate-interface g3 LAN2_inside
ciscoasa(config-ctx)# config-url disk0:/LAN2.cfg
- Thực hiện "show context" để kiểm tra
Code:
ciscoasa(config)# sh context
Context Name      Class      Interfaces           URL
*admin            default                         disk0:/admin.cfg
LAN1             default    GigabitEthernet0,    disk0:/LAN1.cfg
                             GigabitEthernet1
LAN2             default    GigabitEthernet2,    disk0:/LAN2.cfg
                             GigabitEthernet3
- Thực hiện "no shutdown" các interface đãn gán vào các context
Code:
ciscoasa(config-if)# int g0
ciscoasa(config-if)# no shutdown
ciscoasa(config-if)# int g1
ciscoasa(config-if)# no shutdown
ciscoasa(config-if)# int g2
ciscoasa(config-if)# no shutdown
ciscoasa(config-if)# int g3
ciscoasa(config-if)# no shutdown

virtual firewall with non shared interfaces(9)
 
Last edited:

III. Kiểm tra và cấp tài nguyên cho các Security Context trên Firewall Cisco ASA


1. Các PC truy cập lẫn nhau
- Trên PC 1 các truy cập internet thành công.

virtual firewall with non shared interfaces (3)

- Tương tự trên PC 2 cũng truy cập internet thành công.


virtual firewall with non shared interfaces (4)

- Nhưng giữa các pc thuộc Context LAN1 và LAN2 không thể liên lạc được với nhau. Nguyên nhân đơn giản theo hình ở trên PC 2 không ping được PC 1 vì PC 2 nằm ở vùng outside nên không thể truy cập vào cùng inside của
- Để PC có thể ping được PC 1 bạn cần có 1 ACl cho phép PC 2 (outside) ping vào vùng inside của context LAN1

Code:
ciscoasa/LAN1(config)# access-list outside_inside extended permit icmp any any
ciscoasa/LAN1(config)# access-group outside_inside in interface outside

- Trên PC 2 thực hiện ping PC 1 thành công như hình.

virtual firewall with non shared interfaces (5)

2. Cấp tài nguyên cho LAN1
- Tạo class tài nguyên cho context

Code:
ciscoasa(config)# class RESOURCE
ciscoasa(config-class)# limit-resource ASDM 5
ciscoasa(config-class)# limit-resource xlates 1000
ciscoasa(config-class)# limit-resource conns 1
- Các bạn thực hiện add context mà bạn muốn cấp tài nguyên vào class RESOURCE
Code:
ciscoasa(config)# context LAN1
ciscoasa(config-ctx)# member RESOURCE
- Trên PC1 thuộc Context LAN1 các bạn thử tiến hành ping và telnet xem có bị limit không

virtual firewall with non shared interfaces (6)

- Các bạn có thể kiểm tra tài nguyên đã cấp trên ASA
Code:
ciscoasa(config-class)# sh resource usage

Resource               Current        Peak      Limit        Denied Context
Conns                        1           3          1            20 LAN1
Hosts                        2           4  unlimited             0 LAN1
Conns                        2           7  unlimited             0 LAN2
Hosts                        3           4  unlimited             0 LAN2
Code:
ciscoasa(config)# sh cpu usage context all

5 sec  1 min  5 min  Context Name
  0.8%   0.2%   0.0%  system
  0.0%   0.0%   0.0%  admin
  0.0%   0.0%   0.0%  LAN1
  0.0%   0.0%   0.0%  LAN2
 
Last edited:

About us

  • Securityzone.vn là một trang web chuyên về an ninh mạng và công nghệ thông tin. Trang web này cung cấp các bài viết, tin tức, video, diễn đàn và các dịch vụ liên quan đến lĩnh vực này. Securityzone.vn là một trong những cộng đồng IT lớn và uy tín tại Việt Nam, thu hút nhiều người quan tâm và tham gia. Securityzone.vn cũng là nơi để các chuyên gia, nhà nghiên cứu, sinh viên và người yêu thích an ninh mạng có thể trao đổi, học hỏi và chia sẻ kiến thức, kinh nghiệm và giải pháp về các vấn đề bảo mật trong thời đại số.

Quick Navigation

User Menu