拓撲圖
配置步驟
1配置端口ip地址,並檢測連通性
服務器 ping pc端
服務器 telnet R3
2配置命令
R3(config)# ip access-list extended go
R3(config-ext-nacl)# deny ip any any //此ACL目的是隔絕外網流量
R3(config-ext-nacl)# exit
R3(config)# interface s0/1/1
R3(config-if)# ip access-group go in
R3(config)#ip inspect name HKH icmp
R3(config)#ip inspect name HKH http // 創建一個檢測規則來檢測ICMP和HTTP流量
R3(config)# ip inspect audit-trail
R3(config)# service timestamps debug datetime msec
R3(config)# logging host 10.132.1.2 //開啟時間戳記記錄和CBAC審計跟蹤信息
R3(config)#int s0/1/1
R3(config-if)# ip inspect HKH out
驗證:
PC端 ping 服務器
F 區域策略防火牆
拓撲圖
1 配置端口地址以及OSPF。
2查看連通性
Pc-a ping pc-c
Pc-c telnet R2
http服務
3配置區域策略防火牆
R3(config)# zone security IN-ZONE //創建區域IN-ZONE
R3(config-sec-zone)# exit
R3(config)# zone security OUT-ZONE //創建區域OUT-ZONE
R3(config-sec-zone)# exit
R3(config)# access-list 101 permit ip 10.132.3.0 0.0.0.255 any //用access-list創建擴展ACL101來在IP層面允許所有從……源網絡地址訪問到任何其他地址
R3(config)# class-map type inspect match-all IN-NET-CLASS-MAP
R3(config-cmap)# match access-group 101
R3(config-cmap)# exit //用 class map type inspect (match all)來創建一個叫 class map type inspect 的class map,用match access-group匹配ACL
R3(config)# policy-map type inspect IN-2-OUT-PMAP //創建策略圖IN-2-OUT-PMAP
R3(config-pmap)# class type inspect IN-NET-CLASS-MAP //定義一個檢測級別類型和參考策略圖
R3(config)# zone-pair security IN-2-OUT-ZPAIR source IN-ZONE destination OUT-ZONE //創建一個區域對IN-2-OUT-ZPAIR對任務一中創建的區域進行源和目的區域定義
R3(config-sec-zone-pair)# service-policy type inspect IN-2-OUT-PMAP
R3(config-sec-zone-pair)# exit
R3(config# interface fa0/1
R3(config-if)# zone-member security IN-ZONE
R3(config-if)# exit
R3(config)# interface s0/1/1
R3(config-if)# zone-member security OUT-ZONE
R3(config-if)# exit
測試:
服務器 ping PC端(防火牆阻擋,外網無法ping通PC端)
PC端 ping 服務器