PDA

View Full Version : Cấu hình Active/Active on Pix 802 (Mô hình 2)



hoangtu_congngheIT
26-06-2011, 07:11 PM
I. Mô tả
Sơ đồ mạng, phân bố IP và cổng kết nối giữa các thiết bị tương ứng như hình dưới:

http://cC0.upanh.com/24.220.31323209.MAP0/activeactive.jpg

Mục tiêu:
- Cấu hình Active/Active trên thiết bị FW1, FW2.
- Sau khi cấu hình xong:
+ FW1: Active với context Admin, standby với context CTX1.
+ FW2: Active với context CTX1, standby với context Admin.
+ PC1 ping thông đến 172.26.26.254 (InternetCloud) thông qua FW1
+ PC2 ping thông đến 172.26.26.254 (InternetCloud) thông qua FW2
+ PC1, PC2 telnet được đến Router (mật khẩu thiết lập là cisco)
- Tắt thiết bị FW1:
+ FW2: Active với context CTX1, và context Admin
+ PC1, PC2 ping thông đến 172.26.26.254 (InternetCloud) thông qua FW2
+ PC1 vẫn giữ phiên telnet đến Router mà không cần đăng nhập >> stateful là okie

II. Giả lập
- GNS3 với IOS Router 3725, IOS Pix Firewall 8.0(2), Virtual PC là vpcs-0.13a


III. Cấu hình

FW1:



# Đặt tên cho thiết bị:
pixfirewall(config)#hostname FW1
FW1(config)#

#FW1 chuyển từ mode single sang mode multiple:
FW1(config)# mode multiple
# sau khi gõ lệnh trên, FW1 sẽ reload lại, lúc đó cần tắt firewall đi rồi bật lại. Có thể kiểm tra # mode hiện tại của FW1 có phải là multiple hay không như sau:

FW1(config)#show mode
Security context mode: multiple
FW1(config)#

# Kích hoạt cổng Ethernet0, Ethernet1, Ethernet2, Ethernet3, Ethernet4:
FW1(config)#interface Ethernet0
FW1(config-if)#no shut
FW1(config-if)#interface Ethernet1
FW1(config-if)#no shut
FW1(config-if)#interface Ethernet2
FW1(config-if)#no shut
FW1(config-if)#interface Ethernet3
FW1(config-if)#no shut
FW1(config-if)#interface Ethernet4
FW1(config-if)#no shut
FW1(config-if)#exit
FW1(config)#

# Cấu hình LAN/Stateful Failover interface
FW1(config)#failover lan unit primary
FW1(config)#failover lan interface MYFAILOVER Ethernet2
FW1(config)#failover link MYFAILOVER Ethernet2F
FW1(config)#failover lan enable
FW1(config)#failover key cisco123
FW1(config)#failover interface ip MYFAILOVER 172.17.1.1 255.255.255.0 standby 172.17.1.7

# Thiết lập Failover group:
FW1(config)#failover group 1
FW1(config-fover-group)#preempt 10
FW1(config-fover-group)#failover group 2
FW1(config-fover-group)#secondary
FW1(config-fover-group)#preempt
FW1(config-fover-group)#replication http
FW1(config-fover-group)#exit
FW1(config)#

# Tạo context, gán interface, lưu cấu hình mỗi context trên flash, join context vào từng group:
FW1(config)#admin-context admin
FW1(config)#context admin
FW1(config-ctx)#allocate-interface Ethernet0
FW1(config-ctx)#allocate-interface Ethernet1
FW1(config-ctx)#config-url flash:/admin.cfg
FW1(config-ctx)#join-failover-group 1
FW1(config-ctx)#context CTX1
FW1(config-ctx)#allocate-interface Ethernet3
FW1(config-ctx)#allocate-interface Ethernet4
FW1(config-ctx)#config-url flash:/CTX1.cfg
FW1(config-ctx)#join-failover-group 2
FW1(config-ctx)#exit
FW1(config)#

# Kích hoạt failover:
FW1(config)#failover


Cấu hình trên context Admin:
# chuyển đến context Admin:
FW1(config)#change context Admin

# Đặt tên context:
FW1/Admin(config)#hostname Admin

# Cấu hình địa chỉ ip hệ thống và standby cho từng interface:
FW1/Admin(config)#interface Ethernet0
FW1/Admin(config-subif)#nameif outside
FW1/Admin(config-subif)#ip address 192.168.1.2 255.255.255.0 standby 192.168.1.7
FW1/Admin(config-subif)#interface Ethernet1
FW1/Admin(config-subif)#nameif inside
FW1/Admin(config-subif)# ip address 10.0.1.1 255.255.255.0 standby 10.0.1.7
FW1/Admin(config-subif)#exit
FW1/Admin(config)#

# Cấu hình Access List cho phép icmp, tcp đi qua Firewall:
FW1/Admin(config)#access-list PING permit icmp any any
FW1/Admin(config)#access-list PING permit ip any any
FW1/Admin(config)#access-group PING in interface outside

# NAT tĩnh PC1:
FW1/Admin(config)#static (inside,outside) 192.168.1.10 10.0.1.10 netmask 255.255.255.255

# Định tuyến tĩnh:
FW1/Admin(config)#route outside 0.0.0.0 0.0.0.0 192.168.1.1
FW1/Admin(config)#change system
FW1(config)#


Cấu hình trên context CTX1
# chuyển đến context Admin:
FW1(config)#change context CTX1

# đặt tên context:
FW1/CTX1(config)#hostname CTX1

# Cấu hình địa chỉ ip hệ thống và standby cho từng interface:
FW1/CTX1(config)#interface Ethernet3
FW1/CTX1(config-subif)#nameif outside
FW1/CTX1(config-subif)#ip address 192.168.30.2 255.255.255.0 standby 192.168.30.7
FW1/CTX1(config-subif)#interface Ethernet4
FW1/CTX1(config-subif)#nameif inside
FW1/CTX1(config-subif)#ip address 10.0.30.1 255.255.255.0 standby 10.0.30.7
FW1/CTX1(config-subif)#exit
FW1/CTX1(config)#

# Cấu hình Access List cho phép icmp, tcp đi qua Firewall:
FW1/CTX1(config)#access-list PING permit icmp any any
FW1/CTX1(config)#access-list PING permit ip any any
FW1/CTX1(config)#access-group PING in interface outside

# NAT tĩnh PC2:
FW1/CTX1(config)#static (inside,outside) 192.168.30.10 10.0.30.10 netmask 255.255.255.255

# Định tuyến tĩnh:
FW1/CTX1(config)#route outside 0.0.0.0 0.0.0.0 192.168.30.1



FW2:



# đặt tên cho FW2:
pixfirewall(config)# hostname FW2
FW2(config)#

# FW2 chuyển từ mode single sang mode multiple:
FW2(config)# mode multiple
# sau khi gõ lệnh trên, FW2 sẽ reload lại, lúc đó cần tắt firewall đi rồi bật lại. Có thể kiểm tra # mode hiện tại của FW2 có phải là multiple hay không như sau:


FW2(config)#show mode
Security context mode: multiple
FW2(config)#

# K ích hoạt cổng Ethernet0, Ethernet1, Ethernet2, Ethernet3, Ethernet4:
FW2(config)#interface Ethernet0
FW2(config-if)#no shut
FW2(config-if)#interface Ethernet1
FW2(config-if)# no shut
FW2(config-if)#interface Ethernet2
FW2(config-if)# no shut
FW2(config-if)#interface Ethernet3
FW2(config-if)# no shut
FW2(config-if)#interface Ethernet4
FW2(config-if)# no shut
FW2(config-if)#exit
FW2(config)#

# Cấu hình LAN/Stateful Failover interface
FW2(config)#failover
FW2(config)#failover lan unit secondary
FW2(config)#failover lan interface MYFAILOVER Ethernet2
FW2(config)#failover link MYFAILOVER Ethernet2
FW2(config)#failover lan enable
FW2(config)#failover key cisco123
FW2(config)#failover interface ip MYFAILOVER 172.17.1.1 255.255.255.0 standby 172.17.1.7


Router1:



# Đặt tên cho Router1:
router(config)# hostname Router1
Router1(config)#

# Cấu hình ip cho interface fa0/0, fa0/1 và fa1/0:
Router1(config)#interface fa 0/0
Router1(config- if)#ip add 192.168.1.1 255.255.255.0
Router1(config- if)#no shut
Router1(config- if)#interface fa 0/1
Router1(config- if)#ip add 192.168.30.1 255.255.255.0
Router1(config- if)#no shut
Router1(config- if)#interface fa 1/0
Router1(config- if)#ip add 172.26.26.1 255.255.255.0
Router1(config- if)#no shut
Router1(config- if)#exit
Router1(config)#

hoangtu_congngheIT
26-06-2011, 07:18 PM
IV. Kết quả
Đồng bộ cấu hình từ FW1 sang FW2, sau khi kết thúc đồng bộ sẽ hiện ra thông báo như hình dưới:

http://cC0.upanh.com/24.220.31323379.PPZ0/copyofpix1.jpg

Show failover on FW1

http://cC2.upanh.com/24.220.31323441.UM30/pix1showfailover.jpg

Show failover on FW2

http://cC8.upanh.com/24.220.31323477.Axm0/pix2showfailover.jpg

Show failover on context admin của FW1

http://cC6.upanh.com/24.220.31323515.1fg0/pix1adminshowfailover.jpg

Show failover on context CTX1 của FW1

http://cC0.upanh.com/24.220.31323559.oop0/pix1ctx1showfailover.jpg

PC1 ping, tracert đến địa chỉ 172.26.26.254 (InternetCloud):

http://cC2.upanh.com/24.221.31323581.Uaa0/ping1.jpg

PC2 ping, tracert đến địa chỉ 172.26.26.254 (InternetCloud):

http://cC4.upanh.com/24.221.31323603.5Bl0/ping2.jpg

Sau khi tắt FW1, Show failover trên FW2:

http://cC3.upanh.com/24.221.31323622.d10/pix2showfailoverpix1failed.jpg

PC1 vẫn giữ phiên telnet đến Router mà không cần đăng nhập:

phamminhtuan
02-07-2011, 12:17 AM
Cám ơn bạn hoangtu_congngheIT nhiều nha!

Bài viết hay lắm!

hoangtu_congngheIT
02-07-2011, 02:25 PM
Cảm ơn thầy Tuấn đã động viên :)