思科nat与h3c的nat过程不一样的:思科是在全局配置命令下做nat配置的,而H3c则是直接在接口上配置nat(哪条nat条目被应用于此接口,直接在此条目上过滤)。思科的这种配置法会使分组数据在路由到出口后,需要按照nat的排序(可通过show run查看排序)来进行匹配,从而满足条件后做NAT。所以配置思科nat时,请注意nat的先后顺序。这个结论是经过无数次的实验而得出的。
实验拓扑
附:R2中10.45.1.0及1.1.1.0网段的接口为outside;192.168.1.0接口为inside。
R2配置:
R2(config)#do sh run
Building configuration...
Current configuration : 1436 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
ip tcp synwait-time 5
!
interface Ethernet0/0
ip address 1.1.1.2 255.255.255.0
ip nat outside
ip virtual-reassembly
half-duplex
!
interface Ethernet0/1
ip address 10.45.1.1 255.255.255.0
ip nat outside
ip virtual-reassembly
half-duplex
!
interface Ethernet0/2
no ip address
shutdown
half-duplex
!
interface Ethernet0/3
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
half-duplex
!
no ip http server
no ip http secure-server
!
no ip classless
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 1.1.1.1
ip route 10.0.0.0 255.0.0.0 10.45.1.3
!
ip nat inside source list wan interface Ethernet0/0 overload
ip nat inside source list wan2 interface Ethernet0/1 overload \\这是nat的顺序
!
!
ip access-list extended wan
&n