eNSP是圖形化網絡仿真平臺,該平臺通過對真實網絡設備的仿真模擬。網絡轉換技術也叫做NAT技術,他的作用就是實現私網IP和公網IP 的轉換來達到網絡的互通 |
實驗環境:
pc:172.16.1.1/24
R1:g0/0/0 172.16.1.254/24 g0/0/1 192.168.1.254/24
server:192.168.1.1/24
pc和server在不同的網段,現在通過配置靜態NAT實現網絡互通。
網絡配置
pc端
R1端
[R1]int GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip add 172.16.1.254 24 [R1-GigabitEthernet0/0/0] May 21 2020 14:46:37-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R1-GigabitEthernet0/0/0]int g0/0/1 [R1-GigabitEthernet0/0/1]ip add 192.168.1.254 24 [R1-GigabitEthernet0/0/1] May 21 2020 14:46:47-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
server端
配置NAT
將192.168.1.20(公網)與172.16.1.1(私網)地址進行綁定
[R1-GigabitEthernet0/0/1]nat static global 192.168.1.20 inside 172.16.1.1
測試
PC>ping 192.168.1.1 Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break From 192.168.1.1: bytes=32 seq=1 ttl=254 time=15 ms From 192.168.1.1: bytes=32 seq=2 ttl=254 time=15 ms From 192.168.1.1: bytes=32 seq=3 ttl=254 time<1 ms From 192.168.1.1: bytes=32 seq=4 ttl=254 time<1 ms From 192.168.1.1: bytes=32 seq=5 ttl=254 time=16 ms --- 192.168.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 0/9/16 ms PC>
由此,NAT轉換配置成功!