日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

网工的常规操作:配置动态NAT

發布時間:2025/3/20 编程问答 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 网工的常规操作:配置动态NAT 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

網工常規操作:配置動態NAT

?

?

實驗目的?

1.?理解動態NAT的轉換原理

2.?掌握動態NAT的配置方法

實驗拓撲

實驗需求

1. 根據實驗拓撲圖,完成設備的基本配置;

2.?在R2上創建Loopback0接口,IP地址是9.2.6.7/32,模擬公網上的一臺服務器;

3.?在R1上配置動態NAT,地址池范圍為12.1.1.11~12.1.1.20,使得PC1和PC2能夠訪問公網服務器。

實驗步驟

步驟1:設備的基本配置

配置PC1

Router>enableRouter#configure terminalRouter(config)#hostname PC1PC1(config)#no ip routingPC1(config)#ip default-gateway 192.168.1.254PC1(config)#interface ethernet0/0PC1(config-if)#ip address 192.168.1.1 255.255.255.0PC1(config-if)#no shutdownPC1(config-if)#endPC1#

配置PC2:???????

Router>enableRouter#configure terminalRouter(config)#hostname PC2PC2(config)#no ip routingPC2(config)#ip default-gateway 192.168.1.254PC2(config)#interface ethernet0/0PC2(config-if)#ip address 192.168.1.2 255.255.255.0PC2(config-if)#no shutdownPC2(config-if)#endPC2#

配置SW1???????

Switch>enaSwitch#conf tSwitch(config)#no ip domain-lookupSwitch(config)#line console 0Switch(config-line)# logging sSwitch(config-line)# exec-t 0 0Switch(config-line)# exitSwitch(config)#hostname SW1SW1(config)#endSW1#

配置R1:???????

Router>enableRouter#configure terminalRouter(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#line console 0R1(config-line)#exec-timeout 0 0R1(config-line)#logging synchronousR1(config-line)#exitR1(config)#interface ethernet0/0R1(config-if)#ip address 192.168.1.254 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#interface ethernet0/1R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#endR1#

配置R2:???????

Router>enableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain-lookupR2(config)#line console 0R2(config-line)#exec-timeout 0 0R2(config-line)#logging synchronousR2(config-line)#exitR2(config)#interface loopback0R2(config-if)#ip address 9.2.6.7 255.255.255.255R2(config-if)#exitR2(config)#interface ethernet0/0R2(config-if)#ip address 12.1.1.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#endR2#

步驟2:配置動態NAT

配置R1???????

R1(config)#ip nat pool xmws 12.1.1.11 12.1.1.20 netmask 255.255.255.0 //創建地址池R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 //通過ACL定義哪些子網能做NATR1(config)#ip nat inside source list 1 pool xmws //關聯ALC和地址池R1(config)#interface ethernet 0/0R1(config-if)#ip nat inside //指定inside接口R1(config-if)#exitR1(config)#interface ethernet 0/1R1(config-if)#ip nat outside //指定outside接口R1(config-if)#exitR1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2 //配置到達公網的默認路由

測試PC1訪問服務器:???????

PC1#ping 9.2.6.7Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

測試PC2訪問服務器:???????

PC2#ping 9.2.6.7Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

檢查R1的NAT表項:

???????

R1#show ip nat translationsPro Inside global Inside local Outside local Outside globalicmp 12.1.1.12:6 192.168.1.1:6 9.2.6.7:6 9.2.6.7:6--- 12.1.1.12 192.168.1.1 --- ---icmp 12.1.1.13:4 192.168.1.2:4 9.2.6.7:4 9.2.6.7:4--- 12.1.1.13 192.168.1.2 --- ---

IT工程師必備的認證https://blog.csdn.net/XMWS_IT/article/details/124015120?spm=1001.2014.3001.5501????????

?

總結

以上是生活随笔為你收集整理的网工的常规操作:配置动态NAT的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。