
{"id":4220,"date":"2020-10-06T14:14:17","date_gmt":"2020-10-06T06:14:17","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=4220"},"modified":"2020-10-06T14:14:17","modified_gmt":"2020-10-06T06:14:17","slug":"nat","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=4220","title":{"rendered":"[ Linux ] &#8211; Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def"},"content":{"rendered":"<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div><div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div>\n<p>\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002<\/p>\n\n\n<p>\u9019\u908a\u5148\u89e3\u91cb\u4e00\u4e0b\u4e00\u4e9b\u76f8\u95dc\u7684\u5c08\u6709\u540d\u8a5e<\/p>\n\n\n<p>NAT \u5c31\u662fIP\u8f49\u767c\uff0c\u7576gateway \u90a3\u53f0\u4e3b\u6a5f\u6536\u5230\u5167\u7db2\u7684ip\u7684\u6642\u5019\u6703\u628a\u767c\u51fa\u53bb\u7684\u5c01\u5305\u8f49\u6210\u5c0d\u5916\u5c01\u5305\uff0c\u53cd\u4e4b\u6536\u5230\u5916\u7db2\u7684\u5c01\u5305\u5f8c\u6703\u518d\u8f49\u56de\u5167\u7db2ip\u7136\u5f8c\u50b3\u9001\u7d66\u5167\u7db2\u76f8\u5c0d\u61c9ip\u7684\u4e3b\u6a5f\u3002<\/p>\n\n\n<p>DNS \u5c31\u662f\u628a\u7db2\u583f\u540d\u7a31\u8f49\u6210ip\u7684\u670d\u52d9 \u73fe\u5728\u5e38\u7528\u7684\u6709google 8.8.8.8 \/ 8.8.4.4 \u9084\u6709\u4e2d\u83ef\u96fb\u4fe1\u7684 168.95.1.1 \/ 168.95.192.1<\/p>\n\n\n<p>DHCP \u5c31\u662f\u81ea\u52d5\u5206\u914dip\u7684\u4e3b\u6a5f\uff0c\u5f9e\u8a2d\u5b9a\u597d\u7684ip\u6c60\u4e2d\u5206\u914dip\u7d66\u4e3b\u6a5f\uff0c\u7576\u4e3b\u6a5f\u7528\u5b8c\u5f8c\u518d\u4ea4\u56deip\u6c60\u4e2d\u7b49\u5f85\u4e0b\u4e00\u6b21\u7684\u5206\u914d\u3002<\/p>\n\n\n<p><strong>gateway \u90a3\u53f0\u4e3b\u6a5f\u7684\u7db2\u8def\u8a2d\u5b9a<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/netplan\/01-network-manager-all.yaml<\/code><\/pre>\n\n\n<pre class=\"wp-block-code\"><code># Let NetworkManager manage all devices on this system\nnetwork:\n  version: 2\n # renderer: NetworkManager\n  ethernets:\n    eno1:\n      addresses: &#091;220.99.16.33\/24]\n      gateway4: 220.99.16.254\n      nameservers:\n        addresses: &#091;8.8.8.8,8.8.4.4]\n      dhcp4: no\n    enx33:\n      addresses: &#091;192.168.61.195\/24]\n      gateway4: 192.168.61.255\n      dhcp4: no\n<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>NAT \u914d\u7f6e<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -A FORWARD -o eno1 -i enx33 -s 192.168.61.195\/24 -m conntrack --ctstate NEW -j ACCEPT\nsudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT\nsudo iptables -t nat -F POSTROUTING\nsudo iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE<\/code><\/pre>\n\n\n<p>\u9019\u908a\u6211\u7565\u904e \u91cd\u958b\u6a5f\u81ea\u52d5\u914d\u7f6eiptables\u7684\u90e8\u4efd\uff0c\u6709\u9700\u6c42\u8acb\u9ede\u9078 \u53c3\u8003\u7db2\u5740\u3002<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u8def\u7531\u8f49\u767c<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/sysctl.conf\n# net .ipv4.ip_forward=1\n\u4fee\u6539\u5f8c\nnet .ipv4.ip_forward=1\n\u5b58\u6a94<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u555f\u7528\u8def\u7531<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -p<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u5b89\u88dd dnsmasq<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>apt install dnsmasq<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u5099\u4efd dnsmasq \u914d\u7f6e\u6587\u4ef6<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>sudo  cp \/etc\/dnsmasq.conf \/etc\/dnsmasq.conf-backup<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u7de8\u8f2f dnsmasq \u914d\u7f6e\u6587\u4ef6<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/dnsmasq.conf\ninterface= enx33\ndhcp-range= 192.168.61.1,192.168.61.194,72h<\/code><\/pre>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u91cd\u555f dnsmasq<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>sudo \/etc\/init.d\/dnsmasq restart<\/code><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<p><strong>client \u90a3\u53f0\u4e3b\u6a5f\u7684\u7db2\u8def\u8a2d\u5b9a<\/strong><\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u7de8\u8f2f\u7db2\u8def\u8a2d\u5b9a<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>\nnano \/etc\/netplan\/01-network-manager-all.yaml\n# Let NetworkManager manage all devices on this system\nnetwork:\n  version: 2\n#  renderer: NetworkManager\n  ethernets:\n    eno1:\n      addresses: &#091;192.168.61.197\/24]\n      gateway4: 192.168.61.195\n      nameservers:\n        addresses: &#091;8.8.8.8,8.8.4.4]\n      dhcp4: no<\/code><\/pre>\n\n\n<p>\u8aaa\u660e\uff1a\u4e3b\u8981\u5c31\u662f gateway4 \u8981\u8a2d\u6210gateway \u90a3\u53f0\u4e3b\u6a5f\u7684ip,\u9084\u6709dns\u8981\u8a2d\u5b9a\u597d\u3002<br \/>\u5982\u679c\u4f60\u8981\u81ea\u52d5\u53d6\u5f97ip \u8acb\u5c07 dhcp4: yes \uff0c\u7136\u5f8c\u62ff\u6389 addresses: [192.168.61.197\/24] \u9019\u6bb5<\/p>\n\n\n<ul class=\"wp-block-list\"><li><strong>\u8f09\u5165\u65b0\u7684\u7db2\u8def\u8a2d\u5b9a<\/strong><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\"><code>sudo netplan apply<\/code><\/pre>\n\n\n<p>\u53c3\u8003\u7db2\u5740\uff1a<br \/><a href=\"https:\/\/www.cnblogs.com\/Security-Darren\/p\/4576731.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.cnblogs.com\/Security-Darren\/p\/4576731.html<\/a><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002<\/p>\n","protected":false},"author":1,"featured_media":3618,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"categories":[32],"tags":[208,217,328,370,407,577],"class_list":["post-4220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-dhcp","tag-dns","tag-ip_local_port_range","tag-linux","tag-nat","tag-ubuntu-18-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a<\/title>\n<meta name=\"description\" content=\"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webteach.tw\/?p=4220\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"og:description\" content=\"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webteach.tw\/?p=4220\" \/>\n<meta property=\"og:site_name\" content=\"\u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-06T06:14:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"jeff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"jeff\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220\"},\"author\":{\"name\":\"jeff\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"headline\":\"[ Linux ] &#8211; Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def\",\"datePublished\":\"2020-10-06T06:14:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220\"},\"wordCount\":43,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"keywords\":[\"DHCP\",\"DNS\",\"ip_local_port_range\",\"linux\",\"NAT\",\"Ubuntu 18.04\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220\",\"name\":\"[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"datePublished\":\"2020-10-06T06:14:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"description\":\"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=4220\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#primaryimage\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"width\":1600,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=4220#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/www.webteach.tw\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[ Linux ] &#8211; Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/\",\"name\":\"\u6df7\u6c34\u6478\u9b5a\",\"description\":\"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webteach.tw\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\",\"name\":\"jeff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"caption\":\"jeff\"},\"sameAs\":[\"http:\\\/\\\/35.72.55.111\"],\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?author=1\"},false]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a","description":"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webteach.tw\/?p=4220","og_locale":"zh_TW","og_type":"article","og_title":"[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a","og_description":"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002","og_url":"https:\/\/www.webteach.tw\/?p=4220","og_site_name":"\u6df7\u6c34\u6478\u9b5a","article_published_time":"2020-10-06T06:14:17+00:00","og_image":[{"width":1600,"height":1200,"url":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","type":"image\/jpeg"}],"author":"jeff","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"jeff","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webteach.tw\/?p=4220#article","isPartOf":{"@id":"https:\/\/www.webteach.tw\/?p=4220"},"author":{"name":"jeff","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"headline":"[ Linux ] &#8211; Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def","datePublished":"2020-10-06T06:14:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=4220"},"wordCount":43,"commentCount":0,"image":{"@id":"https:\/\/www.webteach.tw\/?p=4220#primaryimage"},"thumbnailUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","keywords":["DHCP","DNS","ip_local_port_range","linux","NAT","Ubuntu 18.04"],"articleSection":["Linux"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webteach.tw\/?p=4220#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webteach.tw\/?p=4220","url":"https:\/\/www.webteach.tw\/?p=4220","name":"[ Linux ] - Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def - \u6df7\u6c34\u6478\u9b5a","isPartOf":{"@id":"https:\/\/www.webteach.tw\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=4220#primaryimage"},"image":{"@id":"https:\/\/www.webteach.tw\/?p=4220#primaryimage"},"thumbnailUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","datePublished":"2020-10-06T06:14:17+00:00","author":{"@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"description":"\u7e7c\u4e0a\u6b21\u5206\u5167\u5916\u7db2\u7684\u9700\u6c42\u5b8c\u6210\u5f8c\uff0c\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u9700\u8981\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u624d\u80fd\u5b89\u88dd\u76f8\u95dc\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u4eca\u5929\u6211\u5011\u8981\u5c07\u80fd\u5c0d\u5916\u7684\u90a3\u53f0\u4e3b\u6a5f\u7576\u6210\u5167\u7db2\u7684gateway \u900f\u904e NAT \u8a2d\u5b9a\u5c31\u53ef\u4ee5\u8b93\u5167\u7db2\u7684\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u5230\u5916\u7db2\u3002","breadcrumb":{"@id":"https:\/\/www.webteach.tw\/?p=4220#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webteach.tw\/?p=4220"]}]},{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.webteach.tw\/?p=4220#primaryimage","url":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","contentUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","width":1600,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/www.webteach.tw\/?p=4220#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.webteach.tw\/"},{"@type":"ListItem","position":2,"name":"[ Linux ] &#8211; Ubuntu 18.04 NAT \u8a2d\u5b9a \u8b93\u5167\u7db2\u4e3b\u6a5f\u4e5f\u53ef\u4ee5\u9023\u4e0a\u5c0d\u5916\u7db2\u8def"}]},{"@type":"WebSite","@id":"https:\/\/www.webteach.tw\/#website","url":"https:\/\/www.webteach.tw\/","name":"\u6df7\u6c34\u6478\u9b5a","description":"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webteach.tw\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Person","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520","name":"jeff","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","caption":"jeff"},"sameAs":["http:\/\/35.72.55.111"],"url":"https:\/\/www.webteach.tw\/?author=1"},false]}},"views":7423,"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":2,"sum_votes":6},"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/4220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4220"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/4220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/media\/3618"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}