ASA-vlan-interface
我們都應該了解在路由器上的單臂路由來做多vlan間路由,那麼在ASA之中又如何做呢,如何在ASA中開啟子接口等等,帶着問題我們來看一個top:
<a target="_blank" href="http://blog.51cto.com/attachment/201105/231139462.png"></a>
具體需求:
1,ASA隻通過一條實體線理去路由兩個内網的資料,
2,如何不讓e0/1去接受未打标的資料,
3,内部可以與外部通信通過NAT,
4,内網使用者不能ping通網關,而網關能ping網内使用者
具體網絡配置:
R2:
Interface fa0/0
Ip add 192.168.1.2 255.255.255.0
Exit
Ip route 0.0.0.0 0.0.0.0 192.168.1.1
R3:
Ip add 192.168.2.2 255.255.255.0
No sh
Ip route 0.0.0.0 0.0.0.0 192.168.2.1
R1:
Ip add 192.168.3.2 255.255.255.0
Ip rout 0.0.0.0 0.0.0.0 192.168.3.1
SW1:
Interface fa1/0
Switchport mode access
Switchport access vlan 2
Interface fa1/1
Switchport access vlan 3
Interface fa1/2
Switchport trunk encapsulation dot1q
Switchport mode trunk
Switchport trunk allowed vlan all
Exi
Vlan database
Vlan 2
Vlan 3
ASA:
Interface e0/0
Nameif outside
Security-level 0
Ip add 192.168.3.1 255.255.255.0
Interface e0/1
Interface e0/1.1
Nameif inside1
Security-level 100
Ip add 192.168.1.1 255.255.255.0
Interface e0/1.2
Nameif inside2
Ip add 192.168.2.1 255.255.255.0
Same-security-traffic permit inter-interface/允許内網相同級别vlan之間流量互訪。
Access-list outacl permit icmp any any
Access-group outacl in interface outside
Icmp deny any echo inside1/拒絕各VLANping各自的網關,但網關可以ping客戶。
Icmp deny any echo inside2
Icmp permit any echo-reply inside1
Icmp permit any echo-reply inside2
Nat (inside1) 1 192.168.1.0/内網做PAT出去。
Nat (inside2) 1 192.168.2.0
Global (outside) 1 interface
僅僅隻有如上配置,還是不夠的,你會發現雖然各個VLAN能PAT出去,但是各個VLAN之間是不能互相通信的。當然如果不用NAT去轉換的話他們是可以互相PING的。
要解決一個ASA内網相同安全級别的互相通路不可達問題,我們可以這樣,
因為如果在insideX上啟用了NAT,VLAN2去VLAN3的話,可能也要檢察NAT,那麼,沒有相應的NAT去進行轉換,那麼可能會丢棄封包。方案如下:
利用靜态static:
static (inside1,inside2) 192.168.1.0 192.168.1.0 netmask 255.255.255.0
Static (inside2,inside1) 192.168.2.0 192.168.2.0 netmask 255.255.255.0
這樣就可以實作NAT之後各内網VLAN之間互訪。
NAT測試:
ciscoasa(config)# show xlate
7 in use, 12 most used
Global 192.168.1.0 Local 192.168.1.0
Global 192.168.2.0 Local 192.168.2.0
PAT Global 192.168.3.1(5) Local 192.168.1.2 ICMP id 2096
PAT Global 192.168.3.1(4) Local 192.168.1.2 ICMP id 2095
PAT Global 192.168.3.1(3) Local 192.168.1.2 ICMP id 2094
PAT Global 192.168.3.1(2) Local 192.168.1.2 ICMP id 2093
PAT Global 192.168.3.1(1) Local 192.168.1.2 ICMP id 2092
ciscoasa(config)#
R2 ping R3,R1:與網關
r2#ping 192.168.3.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/19/36 ms
r2#ping 192.168.2.2
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/20/40 ms
r2#ping 192.168.1.1
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r2#
需求滿足,實驗完畢!
本文轉自 Bruce_F5 51CTO部落格,原文連結:http://blog.51cto.com/zenfei/565654