第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完全相同,末進行任何修改。