用Route-Map配置NAT實現雙ISP接入

xsdan發表於2009-01-09
實驗模擬器:DynamipsGUI
實驗目標:透過策略路由對不同原地址資料流量進行分流,使得不同原地址主機透過不同ISP介面訪問Internet,併為不同原地址主機同不同NAT地址進行轉換。
注:實驗操作時ISP1和ISP2有一條鏈路相連,以承擔Internet上相同服務。
[@more@]
配置如下:
R1#sh run
interface FastEthernet0/0 ---------------設定連線的內網
ip address 10.10.24.1 255.255.255.0 secondary
ip address 10.10.23.2 255.255.255.0 secondary
ip address 10.10.23.3 255.255.255.0 secondary
ip address 10.10.24.2 255.255.255.0 secondary
ip address 10.10.24.3 255.255.255.0 secondary
ip address 10.10.23.1 255.255.255.0
ip nat inside
ip policy route-map 10 --------在該埠上將使用route-map 10進行策略控制
interface Serial1/0 ---------配置ISP 1接入埠
ip address 172.168.1.2 255.255.255.0
ip nat outside
interface Serial1/2 ---------配置ISP 2接入埠
ip address 172.168.2.2 255.255.255.0
ip nat outside

router rip
version 2
network 10.0.0.0
network 172.168.1.0
network 172.168.2.0
!
access-list 1 permit 10.10.23.0 0.0.0.255
access-list 2 permit 10.10.24.0 0.0.0.255
ip nat inside source list 1 interface Serial1/0 overload -----Nat轉換,指定原地址為10.10.23.0的主機使用S1/0的地址進行轉換
ip nat inside source list 2 interface Serial1/2 overload -----Nat轉換,指定原地址為10.10.24.0的主機使用S1/2的地址進行轉換
route-map isp permit 10
match ip add 1
set int s1/0
route-map isp permit 20
match ip add 2
set int s 1/2
int f 0/0
ip policy route-map isp
ISP1#sh run
interface Serial1/0
ip address 172.168.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial1/1 -----網際網路上的服務網段
ip address 133.0.0.1 255.255.255.0
serial restart-delay 0
router rip
version 2
network 133.0.0.0
network 172.168.1.0
ISP2#sh run
interface Serial1/1
ip address 133.0.0.254 255.255.255.0
serial restart-delay 0
!
interface Serial1/2
ip address 172.168.2.1 255.255.255.0
serial restart-delay 0
router rip
version 2
network 133.0.0.0
network 172.168.2.0
驗證:
R1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 172.168.1.2:10 10.10.23.1:10 133.0.0.1:10 133.0.0.1:10
icmp 172.168.2.2:9 10.10.24.3:9 133.0.0.1:9 133.0.0.1:9

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/262387/viewspace-1015916/,如需轉載,請註明出處,否則將追究法律責任。

相關文章