動態NAT



今天做了一個動態NAT的實驗,也趁這個機會把相關的內容貼上來,讓各位網友指點下,先說一個拓樸圖,在這裏用一臺PC 作爲外網,不設置網關,內網設置RIP ,同時張三層交換機的F0/1設置爲NO SWITCHPORT方式劃分兩個VLAN 2 3,在沒有設置NAT前內網之間是可以相互訪問的,但是不能訪問外網即是1。1。1。1
NAT的設置:
在路由器上:(F0/1:192。168。1。1 F0/0:1。1。1。2)
inf f0/1
ip add 192.168.1.1 255.255.255.0
ip nat inside
no sh
int f0/0
ip add 1.1.1.2 255.0.0.0
ip nat outside
no sh
ip nat pool ouhuahe3628 1.1.1.3 1.1.1.8 netmask 255.0.0.0
access-list 1 permit 192.168.2.0 0.0.0.255
ip nat inside source list 1 pool ouhuahe3628
PC>ping 1.1.1.1
Pinging 1.1.1.1 with 32 bytes of data:
Reply from 1.1.1.1: bytes=32 time=94ms TTL=126
sh ip nat tran
Router>en
Router#sh ip nat tran
Pro  Inside global     Inside local       Outside local      Outside global
---  1.1.1.3           192.168.2.2        ---                ---
---  1.1.1.4           192.168.2.5        ---                ---
---  1.1.1.5           192.168.3.2        ---                ---
由於沒有給3網段設置NAT故不能訪問外網……
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章