Tham khảo ebook:
– [Ebook] Cisco ASA All-in-one Next-Generation Firewall, IPS, and VPN Services, 3rd Edition
Sơ đồ:
Hình 1 – Sơ đồ bài lab
Mô tả:
Bài lab này sẽ hướng dẫn kĩ thuật định tuyến động ( dynamic routing) trên firewall ASA. Chúng ta sẽ thực hiện cấu hình OSPF trên firewall ASA.
Bước 1: Cấu hình cơ bản
Đầu tiên chúng ta sẽ cấu hình IP cho các router R1,R2,R3
R1(config)# interface FastEthernet0/0 R1(config-if)#ip add 192.168.10.2 255.255.255.0 R1(config-if)#no shutdown R1(config)#int loop0 R1(config-if)#ip add 172.16.1.1 255.255.255.0
R2(config)# interface Loopback0 R2(config-if)# ip address 172.16.2.1 255.255.255.0 R2(config)# interface FastEthernet0/0 R2(config-if)# ip address 192.168.10.3 255.255.255.0 R2(config-if)# no shutdown
R3(config)# interface Loopback0 R3(config-if)# ip address 172.16.3.1 255.255.255.0 R3(config)# interface FastEthernet0/1 R3(config-if)# ip address 209.165.200.226 255.255.255.224 R3(config-if)# no shutdown
Tiếp theo chúng ta sẽ cấu hình IP, security-level cho firewall ASA.
ASA(config)# int g0/1 ASA(config-if)# nameif inside ASA(config-if)# ip add 209.165.200.225 255.255.255.224 ASA(config-if)# no shutdown ASA(config-if)# exit
ASA(config)# int g0/0 ASA(config-if)# nameif outside ASA(config-if)# ip add 192.168.10.1 255.255.255.0 ASA(config-if)# no shutdown
Bước 2: Cấu hình OSPF
Đầu tiên chúng ta sẽ cấu hình OSPF cho các router R1, R2, R3.
R1(config)#router ospf 1 R1(config-router)#network 192.168.10.0 0.0.0.255 area 0 R1(config-router)#network 172.16.1.0 0.0.0.255 area 0
R2(config)#router ospf 1 R2(config-router)#network 192.168.10.0 0.0.0.255 area 0 R2(config-router)#network 172.16.2.0 0.0.0.255 area 0
R3(config)#router ospf 1 R3(config-router)#network 209.165.200.224 0.0.0.31 area 1 R3(config-router)#network 172.16.3.0 0.0.0.255 area 1
Tiếp theo chúng ta sẽ cấu hình OSPF trên firewall ASA.
ASA(config)# router ospf 1 ASA(config-router)# network 192.168.10.0 255.255.255.0 area 0 ASA(config-router)# network 209.165.200.224 255.255.255.224 area 1
Cấu trúc của nhóm lệnh trên như sau:
– router ospf 1 : 1 ở đây là process-id.
– network subnet subnet_mask area <area-id> : đưa 1 subnet vào process ospf và định nghĩa subnet đó thuộc area nào.
Kiểm tra:
Chúng ta sẽ kiểm tra route trong bảng route trên firewall ASA bằng command “ show route”.
ASA# show route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C 192.168.10.0 255.255.255.0 is directly connected, outside O 172.16.1.1 255.255.255.255 [110/11] via 192.168.10.2, 0:00:05, outside O 172.16.3.1 255.255.255.255 [110/11] via 209.165.200.226, 0:00:05, inside O 172.16.2.1 255.255.255.255 [110/11] via 192.168.10.3, 0:00:05, outside C 209.165.200.224 255.255.255.224 is directly connected, inside
Tiếp theo chúng ta sẽ kiểm tra thiết lập neighbor trên ASA bằng command “show ospf neighbor”.
ASA# show ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.1.1 1 FULL/BDR 0:00:31 192.168.10.2 outside 172.16.2.1 1 FULL/DR 0:00:39 192.168.10.3 outside 172.16.3.1 1 FULL/DR 0:00:39 209.165.200.226 inside
Để xem bảng database trên ASA chúng ta dùng command “show database”.
ASA# show ospf database OSPF Router with ID (209.165.200.225) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 172.16.1.1 172.16.1.1 778 0x80000005 0x46af 2 172.16.2.1 172.16.2.1 780 0x80000003 0x5b98 2 209.165.200.225 209.165.200.225 42 0x80000002 0x1eda 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.10.3 172.16.2.1 55 0x80000002 0x3a24 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 172.16.3.1 209.165.200.225 32 0x80000001 0xf05e 209.165.200.224 209.165.200.225 32 0x80000001 0x 807 Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 172.16.3.1 172.16.3.1 42 0x80000005 0xb2e2 2 209.165.200.225 209.165.200.225 43 0x80000001 0x8619 1 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 209.165.200.226 172.16.3.1 44 0x80000001 0x 191 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.16.1.1 209.165.200.225 44 0x80000001 0x 74a 172.16.2.1 209.165.200.225 44 0x80000001 0xfb54 192.168.10.0 209.165.200.225 44 0x80000001 0x7726
Sau cùng chúng ta sẽ tiến hành ping kiểm tra
ASA# ping 172.16.3.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms ASA# ping 172.16.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms ASA# ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!!
Đến đây thì chúng ta đã cấu hình thành công bài lab số 5 – OSPF ! Chúc các bạn thành công.