route-map t0 permit 10 ----定义route-map t0,permit序列为10 match ip address 1 &nbs
p; ----检查原地址,答应100.100.23.0 网段地址 set interface FastEthernet0/0 ----指定出口为Fastethetnet 0/0 ! route-map t0 permit 20 ----定义route-map t0,permit序列为20 match ip address 2 ----检查原地址,答应100.100.24.0 网段地址 set interface FastEthernet0/1 ----指定出口为Fastethetnet 0/1 ! ! dial-peer cor custom ! ! ! ! line con 0 line aux 0 line vty 0 4 ! end
效果检验: 察看路由表 Router#show ip 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, su - IS-IS summary, 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
100.0.0.0/16 is subnetted, 1 subnets C 100.100.0.0 is directly connected, Ethernet1/0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.2.0/24 is directly connected, FastEthernet0/1 S* 0.0.0.0/0 [1/0] via 192.168.1.1 [1/0] via 192.168.2.1 发现静态路由存在两条路径!
察看ip Nat translations Router#sho ip nat translations
PRo Inside global Inside local Outside local Outside global icmp 192.168.1.2:1024 100.100.23.23:1024 1.1.1.1:1024 1.1.1.1:1024 icmp 192.168.2.2:1280 100.100.24.23:1280 1.1.1.1:1280 1.1.1.1:1280