基于用戶的MPF
創(chuàng)新互聯(lián)主營龍安網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都app軟件開發(fā),龍安h5微信小程序搭建,龍安網(wǎng)站營銷推廣歡迎龍安等地區(qū)企業(yè)咨詢username user1 password cisco username user2 password cisco ! !創(chuàng)建兩個賬號給用戶認(rèn)證用 object-group user group1 ! !創(chuàng)建一個對象組 user Local\user1 ! !匹配本地數(shù)據(jù)的用戶,也可以是ACS。 object-group user group2 user Local\user2 access-list 100 extended permit tcp any any eq 80 ! !匹配流量 aaa authentication match 100 inside LOCAL ! !只要是這些流量都做認(rèn)證,認(rèn)證數(shù)據(jù)庫為本地 access-list filter-shrun permit tcp object-group-user group1 any any eq www ! !匹配流量,并且是用戶1的。 access-list filter-who permit tcp object-group-user group2 any any eq www regex who "who" ! !配置正則表達(dá)式,有”who”關(guān)鍵字的 regex shrun "sh/run" class-map class1 match access-list filter-shrun !! 匹配流量 class-map class2 match access-list filter-who policy-map type inspect http policy-map1 !! 注意,這是5-7層 parameters match request uri regex shrun ! !當(dāng)這個流量中,有正則表達(dá)式里的關(guān)鍵字時 drop-connection log ! !丟棄并且做log policy-map type inspect http policy-map2 parameters match request uri regex who reset policy-map global_policy class class1 inspect http policy-map1 !! 深度過濾 class class2 inspect http policy-map2Botnet Traffic Filter
ASDM自行添加即可
NAT
Object NAT:只能轉(zhuǎn)換源或目的IP
Twice NAT:在滿足策略下轉(zhuǎn)換源和目IP
靜態(tài)(常用于指定服務(wù)器對外端口轉(zhuǎn)換),PAT(動態(tài)地址加端口轉(zhuǎn)換),identity NAT(旁路部分地址)
一個網(wǎng)段轉(zhuǎn)換一個地址范圍
配置動態(tài)NAT object network innet subnet 192.168.17.0 255.255.255.0 object network outnet range 192.168.16.60 192.168.16.70 object network innet nat (inside,outside) dynamic outnet 查看 ASA(config)# show xlate 1 in use, 1 most used Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap, s - static, T - twice, N - net-to-net NAT from inside:192.168.17.100 to outside:192.168.16.65 flags i idle 0:01:03 timeout 3:00:00 ASA(config)# show running-config nat ! object network innet nat (inside,outside) dynamic outnet ASA(config)# show running-config object network object network innet subnet 192.168.17.0 255.255.255.0 object network outnet range 192.168.16.60 192.168.16.70 ASA(config)# show running-config timeout timeout xlate 3:00:00 timeout pat-xlate 0:00:30 .. 更改nat超時時間 ASA(config)# timeout xlate 1:0:0 清除轉(zhuǎn)換表 ASA(config)# clear xlate靜態(tài)nat
把動態(tài)的 object中的網(wǎng)段范圍換成host 再改靜態(tài)就可以了一個范圍轉(zhuǎn)換一個地址不同端口
PAT ! object network innet nat (inside,DMZ) dynamic 192.168.12.110 //直接指向一個地址即可 ASA# show xlate 1 in use, 2 most used Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap, s - static, T - twice, N - net-to-net TCP PAT from inside:192.168.17.100/49526 to DMZ:192.168.12.110/49526 flags ri idle 0:01:15 timeout 0:00:30先動態(tài)轉(zhuǎn)換,地址池用盡再切換PAT
object network outpool range 192.168.16.119 192.168.16.120 object network innet subnet 7.7.7.0 255.255.255.0 ! object network innet nat (inside,outside) dynamic outpool interface //若地址池用盡就用接口的ip做patASA# show x 4 in use, 4 most used Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap, s - static, T - twice, N - net-to-net ICMP PAT from inside:7.7.7.1/14 to DMZ:192.168.12.139/14 flags ri idle 0:00:04 timeout 0:00:30 NAT from inside:7.7.7.3 to DMZ:192.168.12.119 flags i idle 0:00:08 timeout 1:00:00 NAT from inside:7.7.7.2 to DMZ:192.168.12.120 flags i idle 0:00:06 timeout 1:00:00 ICMP PAT from inside:7.7.7.7/15 to DMZ:192.168.12.139/15 flags ri idle 0:00:01 timeout 0:00:30PAT地址池
nat (inside,DMZ) dynamic pat-pool dmzpool round-robin 動態(tài)轉(zhuǎn)換到dmzpool里的地址的不同端口 round-robin表示輪詢地址池里的地址ASA(config-network-object)# show x 4 in use, 4 most used Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap, s - static, T - twice, N - net-to-net ICMP PAT from inside:7.7.7.1/22 to DMZ:192.168.12.119/22 flags ri idle 0:00:03 timeout 0:00:30 ICMP PAT from inside:7.7.7.3/20 to DMZ:192.168.12.119/20 flags ri idle 0:00:07 timeout 0:00:30 ICMP PAT from inside:7.7.7.2/21 to DMZ:192.168.12.120/21 flags ri idle 0:00:05 timeout 0:00:30 ICMP PAT from inside:7.7.7.7/23 to DMZ:192.168.12.120/23 flags ri idle 0:00:01 timeout 0:00:30靜態(tài)PAT
object network DMZ_Web_Server host 192.168.12.100 nat (DMZ,outside) static interface service tcp www www // ftp 2121 等等 //注: 有這句,能訪問192.168.16.139,但不能訪問192.168.12.100 沒有這句,能訪問192.168.12.100 access-list out-dmz extended permit tcp any object DMZ_Web_Server eq www access-group out-dmz in interface outsideASA(config-network-object)# show x 1 in use, 4 most used Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap, s - static, T - twice, N - net-to-net TCP PAT from DMZ:192.168.12.100 80-80 to outside:192.168.16.139 80-80 flags sr idle 0:02:40 timeout 0:00:00outside 口抓包:
dmz口抓包:
Static NAT DNS Rewrite
注:在ASA上必須激活DNS inspection
object network Inside-Web-Server host 10.1.1.101 object network Inside-Web-Server nat (Inside,Outside) static 202.100.1.101 dns篡改dns解析的地址,內(nèi)網(wǎng)訪問www.cisco.com實際上是訪問內(nèi)網(wǎng)的一臺web服務(wù)器
Dynamic Identity NAT
Dynamic Identity NAT轉(zhuǎn)換本地地址到相同的地址,到低安全級別的接口。(只能高到低)
Outbound流量會在轉(zhuǎn)換表中產(chǎn)生一個臨時的轉(zhuǎn)換槽位。
Static Identity NAT
同上,不過是永久表項
Twice Nat
只有源目符合的才會被匹配轉(zhuǎn)換,
若只從object nat 中旁路一些數(shù)據(jù)包(由此可見,twice nat 默認(rèn)優(yōu)先 object nat),可以把轉(zhuǎn)換前后設(shè)置一致,類似identity nat,當(dāng)然也可以設(shè)置其他(如***配置)
object network dst-1 host 1.1.1.1 object network dst-202 host 202.100.1.1 object network pat-1 host 202.100.1.101 object network pat-2 host 202.100.1.102 object network Inside-Network subnet 10.1.1.0 255.255.255.0 object service telnet23 service tcp destination eq telnet object service telnet3032 service tcp destination eq 3032 nat (Inside,Outside) source dynamic Inside-Network pat-1 destination static dst-1 dst-1 service telnet23 telnet23 nat (Inside,Outside) source dynamic Inside-Network pat-2 destination static dst-202 dst-202 service telnet3032 telnet3032Network Object NAT和Twice NAT的主要區(qū)別
object nat:nat是object的一個參數(shù),實體為object,可以方便的被用于調(diào)用(如:ACL),只能改源或目
twice nat:object是nat的一個參數(shù),可以添加自定義的object(或group),擴(kuò)展性強(qiáng),可以同時改源目
nat順序
優(yōu)先級一:
Twice NAT 敲入的順序
Twice可以隨意調(diào)整順序
優(yōu)先級二: Object NAT
靜態(tài)轉(zhuǎn)換優(yōu)先于動態(tài)轉(zhuǎn)換
如果類型相同,按照如下方式排序
1.地址范圍
2.IP地址數(shù)字大小
4.Object名字排序
優(yōu)先級三: Twice NAT
after-auto
更改排序
默認(rèn)twice nat優(yōu)先object nat,當(dāng)在twice nat加after-auto參數(shù),就會放在object nat之后
nat (Inside,Outside) after-auto source dynamic Inside-Network pat-1 destination static dst-1 dst-1 service telnet23 telnet23后敲的twice nat要排在前面,需要加 1
nat (Inside,Outside) 1 source dynamic Inside-Network pat-1 destination static dst-1 dst-1 service telnet23 telnet23另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。