第1段:路由器R1的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service passWord-encryption hostname R1 ! ip subnet-zero ! interface Ethemet0 ip address 10.1.1.10 255.255.255.0 ip nat inside ! interface Serial0 ip address 198.1.1.1255.255.255.0 ip nat outside ! ip nat pool lab3 198.1.1.5 198.1.1.5 netmask 255.255.255.0 ip nat inside source list 1 pool lab3 overload ip classless ip route 0.0.0.0 0.0.0.0 Serial0 ip http server ! access-list 1 permit 10.1.1.0 0.0.0.255 ! line con 0 line aux 0 line vty 0 4 login ! end 第2段:路由器R2的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 ip subnet-zero no ip finger ! interface Loopback0 ip address 202.1.1.2 255.255.255.0 secondary ! ip address 202.1.1.3 255.255.255.0 secondary ip address 202.1.1.4 255.255.255.0 secondary ip address 202.1.1.1255.255.255.0 ! interface Serial0 ip address 198.1.1.2 255.255.255.0 clockrate 64000 ! ip classless ip http server ! line con 0 line aux 0 line vty 0 4 password cisco login ! end 第3段:路由器R3的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R3 ! ip subnet-zero no ip routing ! interface Ethernet0 ip address 10.1.1.2 255.255.255.0 secondary ip address 10.1.1.3 255.255.255.0 secondary ip address 10.1.1.4 255.255.255.0 secondary ip address 10.1.1.5 255.255.255.0 secondary ip address 10.1.1.6 255.255.255.0 secondary ip address 10.1.1.7 255.255.255.0 secondary ip address 10.1.1.1255.255.255.0 no ip route-cache no ip mroute-cache ! ip default-gateway 10.1.1.10 ip classless ip http server ! line con 0 transport input none line aux 0 line vty 0 4 password cisco login ! end
(1)在对R1的配置中,把S0设置成NAT外部接口;把E0设置成NAT内部接口。 (2)定义了一个名为lab3的NAT地址池,它的开始和结束地址均为198.1.1.5,是属于串行接口所在网段的地址。 (3)复用内部全局地址的地址转换配置语句为: ip nat inside source list 1 pool lab3 overload 与配置动态内部源地址转换所不同的是加入了要害词overload,启动了复用功能。由访问列表1所定义的地址范围内的内网IP地址将被进行地址转换,转换后的地址是名为lab3的NAT地址池中的IP地址。 (4)访问列表1定义的地址范围是10.1.1.0/24的内网网段。 (5)配置中。对R2路由器把S0接口的IP子网掩码进行了更改,同时删去了原来的静态路由设置。 (6)R3路由器的配置与实验2完全相同,末进行任何修改。