全網以互聯互通!如有什麼疑問去看上一篇文章(拓撲圖)!
接下來我們做NAPT 有VLAN2 VLAN 3的右邊拓撲 作爲內網!
左邊作爲外網!
允許VLAN2 192.168.2.0 這個網段 進行網絡地址轉換訪問外網
下面對Router2進行配置
Router2
Router>enable
Router#configure terminal
Router(config)#interface serial 2/0
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#interface fastEthernet 1/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#access-list 1 permit 192.168.2.0 0.0.0.255
Router(config)#ip nat inside source list 1 interface serial 2/0 overload
(不用創建地址池,直接借用F1/0的IP地址,F1/0獲取什麼地址就使用什麼地址。這樣配置NAT超載就從5步驟變成4步驟,該方法同樣適用於靜態接入)
用VLAN2 PC ping VLAN 5! 發現可以ping通
PC>ping 192.168.5.2
Pinging 192.168.5.2 with 32 bytes of data:
Reply from 192.168.5.2: bytes=32 time=219ms TTL=124
Reply from 192.168.5.2: bytes=32 time=218ms TTL=124
Reply from 192.168.5.2: bytes=32 time=172ms TTL=124
Reply from 192.168.5.2: bytes=32 time=172ms TTL=124
Ping statistics for 192.168.5.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 172ms, Maximum = 219ms, Average = 195ms
路由器上顯示:
Router#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 60.12.3.5:16 192.168.2.2:16 192.168.5.2:16 192.168.5.2:16
icmp 60.12.3.5:17 192.168.2.2:17 192.168.5.2:17 192.168.5.2:17
icmp 60.12.3.5:18 192.168.2.2:18 192.168.5.2:18 192.168.5.2:18
icmp 60.12.3.5:19 192.168.2.2:19 192.168.5.2:19 192.168.5.2:19
icmp 60.12.3.5:20 192.168.2.2:20 192.168.5.2:20 192.168.5.2:20
期末考試兩篇內容已更新完成!希望對同學們有幫助,別掛科!
原創:胡斌
我會從簡單到難的發表一些我學過的知識,希望能給一些想入門的朋友幫助,也希望找一些志同道合的朋友、老師 給我些指教。 QQ 276200261!