{"id":174946,"date":"2020-03-25T15:46:22","date_gmt":"2020-03-25T07:46:22","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=174946"},"modified":"2020-03-24T12:16:31","modified_gmt":"2020-03-24T04:16:31","slug":"network-address-translation","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/network-address-translation.html","title":{"rendered":"\u7f51\u7edc\u5730\u5740\u8f6c\u6362 NAT \u914d\u7f6e"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u672c\u6587\u6863\u8be6\u7ec6\u4ecb\u7ecd\u7f51\u7edc\u5730\u5740\u8f6c\u6362 NAT \u914d\u7f6e<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u5b9e\u9a8c\u76ee\u6807<\/strong><\/div>\n \u7406\u89e3 NAT \u7f51\u7edc\u5730\u5740\u8f6c\u6362\u7684\u539f\u7406\u53ca\u529f\u80fd \u5b9e\u9a8c\u80cc\u666f<\/strong><\/div>\n \u4f60\u662f\u67d0\u516c\u53f8\u7684\u7f51\u7edc\u7ba1\u7406\u5458\uff0c\u6b32\u53d1\u5e03\u516c\u53f8\u7684 WWW \u670d\u52a1\u3002\u73b0\u8981\u6c42\u5c06\u5185\u7f51 Web \u670d\u52a1\u5668 IP\u5730\u5740\u6620\u5c04\u4e3a\u5168\u5c40 IP \u5730\u5740\uff0c\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u53ef\u4ee5\u8bbf\u95ee\u516c\u53f8\u5185\u90e8 Web \u670d\u52a1\u5668\u3002<\/p>\n \u6280\u672f\u539f\u7406<\/strong><\/div>\n \u7f51\u7edc\u5730\u5740\u8f6c\u6362 NAT\uff08Network Address Translation\uff09\uff0c\u88ab\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5404\u79cd\u7c7b\u578b Internet \u63a5\u5165\u65b9\u5f0f\u548c\u5404\u79cd\u7c7b\u578b\u7684\u7f51\u7edc\u4e2d\u3002\u539f\u56e0\u5f88\u7b80\u5355\uff0cNAT \u4e0d\u4ec5\u5b8c\u7f8e\u5730\u89e3\u51b3\u4e86 IP \u5730\u5740\u4e0d\u8db3\u7684\u95ee\u9898\uff0c\u800c\u4e14\u8fd8\u80fd\u591f\u6709\u6548\u5730\u907f\u514d\u6765\u81ea\u7f51\u7edc\u5916\u90e8\u7684\u653b\u51fb\uff0c\u9690\u85cf\u5e76\u4fdd\u62a4\u7f51\u7edc\u5185\u90e8\u7684\u8ba1\u7b97\u673a\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5185\u90e8 IP \u5730\u5740\u662f\u65e0\u6cd5\u88ab\u8def\u7531\u5230\u5916\u7f51\u7684\uff0c\u5185\u90e8\u4e3b\u673a 10.1.1.1 \u8981\u4e0e\u5916\u90e8 Internet\u901a\u4fe1\uff0cIP \u5305\u5230\u8fbe NAT \u8def\u7531\u5668\u65f6\uff0cIP \u5305\u5934\u7684\u6e90\u5730\u5740 10.1.1.1 \u88ab\u66ff\u6362\u6210\u4e00\u4e2a\u5408\u6cd5\u7684\u5916\u7f51 IP\uff0c\u5e76\u5728 NAT \u8f6c\u53d1\u8868\u4e2d\u4fdd\u5b58\u8fd9\u6761\u8bb0\u5f55\u3002\u5f53\u5916\u90e8\u4e3b\u673a\u53d1\u9001\u4e00\u4e2a\u5e94\u7b54\u5230\u5185\u7f51\u65f6\uff0cNAT \u8def\u7531\u5668\u6536\u5230\u540e\uff0c\u67e5\u770b\u5f53\u524d NAT \u8f6c\u6362\u8868\uff0c\u7528 10.1.1.1 \u66ff\u6362\u6389\u8fd9\u4e2a\u5916\u7f51\u5730\u5740\u3002NAT \u5c06\u7f51\u7edc\u5212\u5206\u4e3a\u5185\u90e8\u7f51\u7edc\u548c\u5916\u90e8\u7f51\u7edc\u4e24\u90e8\u5206\uff0c\u5c40\u57df\u7f51\u4e3b\u673a\u5229\u7528 NAT \u8bbf\u95ee\u7f51\u7edc\u65f6\uff0c\u662f\u5c06\u5c40\u57df\u7f51\u5185\u90e8\u7684\u672c\u5730\u5730\u5740\u8f6c\u6362\u4e3a\u5168\u5c40\u5730\u5740\uff08\u4e92\u8054\u7f51\u5408\u6cd5\u7684 IP \u5730\u5740\uff09\u540e\u8f6c\u53d1\u6570\u636e\u5305\uff1b<\/p>\n NAT \u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\uff1aNAT\uff08\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff09\u548c NAPT\uff08\u7f51\u7edc\u7aef\u53e3\u5730\u5740\u8f6c\u6362 IP \u5730\u5740\u5bf9\u5e94\u4e00\u4e2a\u5168\u5c40\u5730\u5740\uff09\u3002 \u5b9e\u9a8c\u6b65\u9aa4<\/strong><\/div>\n \u65b0\u5efa Packet Tracer \u62d3\u6251\u56fe<\/p>\n <\/p>\n \uff081\uff09R1 \u4e3a\u516c\u53f8\u51fa\u53e3\u8def\u7531\u5668\uff0c\u5176\u4e0e\u5916\u90e8\u8def\u7531\u5668\u4e4b\u95f4\u901a\u8fc7 V.35 \u7535\u7f06\u4e32\u53e3\u8fde\u63a5\uff0cDCE \u7aef\u8fde\u63a5\u5728 R1 \u4e0a\uff0c\u914d\u7f6e\u5176\u65f6\u949f\u9891\u7387 64000\uff1b \u5b9e\u9a8c\u8bbe\u5907<\/strong><\/div>\n PC 1 \u53f0\uff1bServer-PT 1 \u53f0\uff1bSwitch_2950-24 1 \u53f0\uff1bRouter-PT 2 \u53f0\uff1b\u76f4\u8fde\u7ebf\uff1b\u4ea4\u53c9\u7ebf\uff1bDCE\u4e32\u53e3\u7ebf\r\n\r\nServer-PT\r\n\r\n192.168.1.2\r\n255.255.255.0\r\n192.168.1.1\r\n\r\nPC0\r\n\r\n222.0.2.2\r\n255.255.255.0\r\n222.0.2.1\r\n\r\nR1\r\n\r\nen\r\nconf t\r\nhost R1\r\nint fa 0\/0\r\nip address 192.168.1.1 255.255.255.0\r\nno shutdown\r\nint s 2\/0\r\nip address 222.0.1.1 255.255.255.0\r\nno shutdown\r\nclock rate 64000\r\n\r\nR2\r\n\r\nen\r\nconf t\r\nhost R2\r\nint s 2\/0\r\nip address 222.0.1.2 255.255.255.0\r\nno shut\r\nint fa 0\/0\r\nip address 222.0.2.1 255.255.255.0\r\nno shutdown\r\n\r\nR1\r\n\r\nexit;\r\nip route 222.0.2.0 255.255.255.0 222.0.1.2\r\n\r\nR2\r\n\r\nexit\r\nip route 192.168.1.0 255.255.255.0 222.0.1.1\r\nend\r\nshow ip route\r\n\r\nPC0\r\n\r\nCMD\r\nping 192.168.1.2 (success)\r\n\r\nWeb \u6d4f\u89c8\u5668\r\nhttp:\/\/192.168.1.2 (success)\r\n<\/pre>\n |