{"id":45351,"date":"2025-06-24T15:21:20","date_gmt":"2025-06-24T07:21:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/45351.html"},"modified":"2025-06-24T15:21:20","modified_gmt":"2025-06-24T07:21:20","slug":"linux-%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bf%90%e7%bb%b4%ef%bc%9a%e7%a3%81%e7%9b%98%e7%ae%a1%e7%90%86%e4%b8%8e%e7%bd%91%e7%bb%9c%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/45351.html","title":{"rendered":"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e"},"content":{"rendered":"<p>&#x1f935;\u200d\u2642\ufe0f \u4e2a\u4eba\u4e3b\u9875&#xff1a;&#064;\u5e03\u8bf4\u5728\u89c1<\/p>\n<p>\u270d&#x1f3fb;\u4f5c\u8005\u7b80\u4ecb&#xff1a; &#x1f40b; \u5e0c\u671b\u5927\u5bb6\u591a\u591a\u652f\u6301&#xff0c;\u6211\u4eec\u4e00\u8d77\u8fdb\u6b65&#xff01;&#x1f604; \u5982\u679c\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684\u8bdd&#xff0c; \u6b22\u8fce\u8bc4\u8bba &#x1f4ac;\u70b9\u8d5e&#x1f44d;&#x1f3fb; \u6536\u85cf&#x1f4c2;\u52a0\u5173\u6ce8&#043;<\/p>\n<\/p>\n<h4>\u76ee\u5f55<\/h4>\n<ul>\n<li>\u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u6838\u5fc3\u6307\u4ee4<\/li>\n<li>\n<ul>\n<li>\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005<\/li>\n<li>\u5b9e\u8df5<\/li>\n<\/ul>\n<\/li>\n<li>Linux \u7cfb\u7edf\u4e2d\u6dfb\u52a0\u65b0\u78c1\u76d8\u7684\u5b8c\u6574\u6307\u5357<\/li>\n<li>\n<ul>\n<li>\u67e5\u8be2\u78c1\u76d8\u7a7a\u95f4<\/li>\n<li>\u5b9e\u6218\u5173\u4e8e\u78c1\u76d8<\/li>\n<\/ul>\n<\/li>\n<li>\u7f51\u7edc\u914d\u7f6e<\/li>\n<li>\n<ul>\n<li>\u67e5\u770b\u7f51\u7edcIP\u548c\u7f51\u5173<\/li>\n<li>\n<ul>\n<li>\u7f51\u7edc\u914d\u7f6e\u5b9e\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ul>\n<h2>\u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c\u6838\u5fc3\u6307\u4ee4<\/h2>\n<p>\u9a8c\u8bc1\u662f\u5426\u8fdb\u5165root &#xff0c;whoami&#xff0c;\u5982\u679c\u662froot\u5c31\u8fdb\u5165\u4e86<\/p>\n<p>linux\u7684 \u6587\u4ef6\/\u76ee\u5f55 \u6240\u6709\u8005 \u67e5\u770b\u6587\u4ef6\u7684\u6240\u6709\u8005 ls -ahl <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072118-685a51eee53fd.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005<\/h3>\n<p>chown \u7528\u6237\u540d \u6587\u4ef6\u540d \u4f7f\u7528root \u521b\u5efa \u4e00\u4e2a\u6587\u4ef6d.txt,\u7136\u540e\u5c06\u5176\u6240\u6709\u8005\u4fee\u6539\u6210ee <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072118-685a51eef1f43.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u6ce8\u610f&#xff0c;\u5176\u4e2d\u7684\u7528\u6237ee\u8981\u5728\u7cfb\u7edf\u4e2d&#xff0c;\u6ca1\u6709\u7528\u6237\u9700\u8981\u5148\u521b\u5efa\u7528\u6237<\/p>\n<p>adduser ee<\/p>\n<p>chgrp \u4fee\u6539\u7ec4\u7684\u6743\u9650 \u5c06\/home\/abc.txt\u7684\u6587\u4ef6\u7684\u6240\u5728\u7ec4\u4fee\u6539\u6210xiaoming \u6dfb\u52a0\u7ec4\u540d<\/p>\n<p>addgroup xiaoming chgrp xiaoming \/home\/abc.txt<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072119-685a51ef0a5e8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072119-685a51ef1735c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u5b9e\u8df5<\/h3>\n<p>\u97e9\u987a\u5e73\u8001\u5e08\u7684linux<\/p>\n<p>police,bandit jack,jerry:\u8b66\u5bdf xh, xq:\u571f\u532a 1.\u521b\u5efa\u7ec4<\/p>\n<p>#\u521b\u5efa\u8b66\u5bdf\u548c\u571f\u532a\u7ec4 groupadd police groupadd bandit<\/p>\n<p>2.\u521b\u5efa\u7528\u6237<\/p>\n<p>#\u521b\u5efa\u8b66\u5bdf\u7528\u6237 sudo useradd -g police jack sudo useradd -g police jerry<\/p>\n<p>#\u521b\u5efa\u571f\u532a\u7528\u6237 useradd -g bandit xh useradd -g bandit xq<\/p>\n<p>3.jack\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6&#xff0c;\u81ea\u5df1\u53ef\u4ee5\u8bfb\u5199&#xff0c;\u672c\u7ec4\u4eba\u53ef\u4ee5\u8bfb&#xff0c;\u5176\u5b83\u7ec4\u6ca1\u4eba\u4efb\u4f55\u6743\u9650<\/p>\n<p>#\u5207\u6362\u5230jack\u7528\u6237 sudo su &#8211; jack<\/p>\n<p>#\u521b\u5efa\u6587\u4ef6\u5e76\u5199\u5165\u5185\u5bb9 echo \u201c\u673a\u5bc6\u6587\u4ef6\u201d &gt; secret.txt<\/p>\n<p>#\u8bbe\u7f6e\u6743\u9650: \u6240\u6709\u8005\u8bfb\u5199&#xff0c;\u7ec4\u5185\u8bfb&#xff0c;\u5176\u4ed6\u65e0\u6743\u9650 chmod 640 secret.txt<\/p>\n<p>#\u9a8c\u8bc1\u6743\u9650 ls -l secret.txt #\u9884\u671f\u8f93\u51fa: -rw-r&#8212;&#8211; 1 jack police \u2026 secret.txt<\/p>\n<p>4.jack\u4fee\u6539\u8be5\u6587\u4ef6&#xff0c;\u8ba9\u5176\u5b83\u7ec4\u4eba\u53ef\u4ee5\u8bfb&#xff0c;\u672c\u7ec4\u4eba\u53ef\u4ee5\u8bfb\u5199<\/p>\n<p>#\u4fee\u6539\u6743\u9650: \u6240\u6709\u8005\u8bfb\u5199&#xff0c;\u7ec4\u5185\u8bfb\u5199&#xff0c;\u5176\u4ed6\u53ea\u8bfb chmod 664 secret.txt<\/p>\n<p>#\u9a8c\u8bc1\u6743\u9650 ls -l secret.txt #\u9884\u671f\u8f93\u51fa: -rw-rw-r&#8211; 1 jack police \u2026 secret.txt <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072119-685a51ef24724.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<li>xh\u6295\u9760\u8b66\u5bdf&#xff0c;\u770b\u770b\u662f\u5426\u53ef\u4ee5\u8bfb\u5199<\/li>\n<p>#\u5207\u6362\u56deroot\u7528\u6237 exit<\/p>\n<p>#\u5c06xh\u4ecebandit\u7ec4\u79fb\u9664&#xff0c;\u52a0\u5165police\u7ec4 sudo usermod -g police xh sudo gpasswd -d xh bandit<\/p>\n<p>#\u5207\u6362\u5230xh\u7528\u6237 sudo su &#8211; xh<\/p>\n<p>#\u6d4b\u8bd5\u8bfb\u5199\u6743\u9650 cat secret.txt # \u5e94\u8be5\u53ef\u4ee5\u8bfb\u53d6 echo \u201c\u65b0\u60c5\u62a5\u201d &gt;&gt; secret.txt # \u5e94\u8be5\u53ef\u4ee5\u5199\u5165<\/p>\n<p>#\u9a8c\u8bc1\u6587\u4ef6\u5185\u5bb9 cat secret.txt<\/p>\n<p>\u63d2\u5165\u4e00\u4e2a\u7b14\u8bb0<\/p>\n<p>\u6865\u63a5\u6a21\u5f0f&#xff0c;\u5bb9\u6613\u9020\u6210ip\u51b2\u7a81 NAT\u6a21\u5f0f&#xff0c; \u4e0d\u9020\u6210ip\u51b2\u7a81 \u4e3b\u673a\u6a21\u5f0f&#xff0c;\u5355\u673a\u6e38\u620f<\/p>\n<h2>Linux \u7cfb\u7edf\u4e2d\u6dfb\u52a0\u65b0\u78c1\u76d8\u7684\u5b8c\u6574\u6307\u5357<\/h2>\n<p>\u67e5\u770b\u78c1\u76d8<\/p>\n<p>#\u5217\u51fa\u6240\u6709\u78c1\u76d8\u548c\u5206\u533a\u4fe1\u606f sudo fdisk -l #\u6811\u5f62\u5c55\u793a\u78c1\u76d8\u7ed3\u6784&#xff08;\u63a8\u8350&#xff09; lsblk<\/p>\n<p>\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\u8bf4\u660e&#xff1a;<\/p>\n<li>\u865a\u62df\u673a\u6dfb\u52a0\u786c\u76d8 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072119-685a51ef39634.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<p><span class=\"token comment\"># \u4ee5VMware\u4e3a\u4f8b&#xff0c;\u5728\u865a\u62df\u673a\u8bbe\u7f6e\u4e2d\u6dfb\u52a0\u65b0\u786c\u76d8\u540e&#xff0c;\u91cd\u542f\u865a\u62df\u673a<\/span><br \/>\nlsblk<\/p>\n<li>\u5206\u533a<\/li>\n<p><span class=\"token comment\">#\u4f7f\u7528fdisk\u8fdb\u884cMBR\u5206\u533a<\/span><br \/>\n<span class=\"token function\">fdisk<\/span> \/dev\/sdb<\/p>\n<p>#\u4f9d\u6b21\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4 n # \u521b\u5efa\u65b0\u5206\u533a p # \u9009\u62e9\u4e3b\u5206\u533a<\/p>\n<p>#\u6309Enter\u9009\u62e9\u9ed8\u8ba4\u8d77\u59cb\u6247\u533a #\u6309Enter\u9009\u62e9\u9ed8\u8ba4\u7ed3\u675f\u6247\u533a&#xff0c;\u5373\u4f7f\u7528\u5168\u90e8\u7a7a\u95f4 w # \u4fdd\u5b58\u5e76\u9000\u51fa<\/p>\n<li>\u683c\u5f0f\u5316\u78c1\u76d8<\/li>\n<p><span class=\"token comment\"># \u683c\u5f0f\u5316\u4e3aext4\u6587\u4ef6\u7cfb\u7edf<\/span><br \/>\n<span class=\"token function\">mkfs<\/span> <span class=\"token parameter variable\">-t<\/span> ext4 \/dev\/sdb1<\/p>\n<p>4.\u6302\u8f7d \u5c06\u4e00\u4e2a\u5206\u533a\u4e0e\u4e00\u4e2a\u76ee\u5f55\u8054\u7cfb\u8d77\u6765<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u6302\u8f7d\u70b9<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> newdisk<\/p>\n<p><span class=\"token comment\"># \u4e34\u65f6\u6302\u8f7d<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> \/dev\/sdb1\/newdisk<\/p>\n<p><span class=\"token function\">umount<\/span> \u5378\u8f7d<br \/>\n\u547d\u4ee4\u884c\u6302\u8f7d\u91cd\u542f\u540e\u4f1a\u5931\u6548<\/p>\n<p>5\u6c38\u4e45\u6302\u8f7d<\/p>\n<p><span class=\"token comment\"># \u7f16\u8f91\/etc\/fstab\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">vi<\/span> \/etc\/fstab<\/p>\n<p><span class=\"token comment\"># \u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff08;\u66ff\u6362\u4e3a\u5b9e\u9645UUID&#xff09;<\/span><br \/>\n\/dev\/sdb1        \/newdisk ext4  defaults   <span class=\"token number\">0<\/span> <span class=\"token number\">0<\/span><\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1fstab\u914d\u7f6e<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-a<\/span> <\/p>\n<h3>\u67e5\u8be2\u78c1\u76d8\u7a7a\u95f4<\/h3>\n<p>du -h \u67e5\u8be2\u6307\u5b9a\u76ee\u5f55\u7684\u78c1\u76d8\u5360\u7528\u60c5\u51b5&#xff0c;\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55<\/p>\n<p>\u529f\u80fd&#xff1a;\u6309\u5360\u7528\u7a7a\u95f4\u4ece\u5c0f\u5230\u5927\u6392\u5e8f\u663e\u793a\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u5b50\u76ee\u5f55\u5360\u7528\u60c5\u51b5 &#xff08;du -h &#8211;max-depth&#061;1 | sort -h&#xff09;<\/p>\n<li>\u7edf\u8ba1 \/opt \u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u7684\u4e2a\u6570&#xff08;\u4e0d\u5305\u542b\u5b50\u6587\u4ef6\u5939&#xff09;<\/li>\n<p>ls -l \/opt | grep \u201c^-\u201d | wc -l<\/p>\n<li>\u7edf\u8ba1 \/opt \u6587\u4ef6\u5939\u4e0b\u76ee\u5f55\u7684\u4e2a\u6570&#xff08;\u4e0d\u5305\u542b\u5b50\u6587\u4ef6\u5939&#xff09;<\/li>\n<p>ls -l \/opt | grep \u201c^d\u201d | wc -l<\/p>\n<li>\u7edf\u8ba1 \/opt \u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u7684\u4e2a\u6570&#xff08;\u5305\u542b\u5b50\u6587\u4ef6\u5939&#xff09;<\/li>\n<p>find \/opt -type f | wc -l<\/p>\n<h3>\u5b9e\u6218\u5173\u4e8e\u78c1\u76d8<\/h3>\n<p>\u573a\u666f <span class=\"token number\">1<\/span>&#xff1a;\u6e05\u7406\u5927\u6587\u4ef6\u524d\u7684\u7edf\u8ba1<br \/>\n<span class=\"token function\">bash<\/span><br \/>\n<span class=\"token comment\"># \u67e5\u627e\/opt\u4e0b\u5927\u4e8e100MB\u7684\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">find<\/span> \/opt <span class=\"token parameter variable\">-type<\/span> f <span class=\"token parameter variable\">-size<\/span> &#043;100M <span class=\"token parameter variable\">-exec<\/span> <span class=\"token function\">du<\/span> <span class=\"token parameter variable\">-h<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">\\\\<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\"># \u7edf\u8ba1\/opt\u4e0b\u5404\u76ee\u5f55\u5360\u7528\u7a7a\u95f4&#xff08;\u6309\u5927\u5c0f\u6392\u5e8f&#xff09;<\/span><br \/>\n<span class=\"token function\">du<\/span> <span class=\"token parameter variable\">-h<\/span> &#8211;max-depth<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> \/opt <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token parameter variable\">-h<\/span><br \/>\n\u573a\u666f <span class=\"token number\">2<\/span>&#xff1a;\u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u68c0\u67e5<br \/>\n<span class=\"token function\">bash<\/span><br \/>\n<span class=\"token comment\"># \u663e\u793a\u9879\u76ee\u76ee\u5f55\u7ed3\u6784&#xff08;\u6700\u591a2\u5c42\u6df1\u5ea6&#xff09;<\/span><br \/>\ntree <span class=\"token parameter variable\">-L<\/span> <span class=\"token number\">2<\/span> \/opt\/project<\/p>\n<p>\u573a\u666f <span class=\"token number\">3<\/span>&#xff1a;\u670d\u52a1\u5668\u78c1\u76d8\u5065\u5eb7\u68c0\u67e5<br \/>\n<span class=\"token function\">bash<\/span><br \/>\n<span class=\"token comment\"># \u67e5\u770b\u6574\u4f53\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/span><br \/>\n<span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span><\/p>\n<p><span class=\"token comment\"># \u7ed3\u5408\u7edf\u8ba1\u4e0e\u53ef\u89c6\u5316&#xff08;\u9700\u5b89\u88c5 ncdu&#xff09;<\/span><br \/>\nncdu \/opt<\/p>\n<h2>\u7f51\u7edc\u914d\u7f6e<\/h2>\n<p>NAT\u7684\u539f\u7406<\/p>\n<p>NAT&#xff08;Network AddressTranslation&#xff0c;\u7f51\u7edc\u5730\u5740\u8f6c\u6362&#xff09;\u662f\u4e00\u79cd\u7528\u4e8e\u5728IP\u6570\u636e\u5305\u901a\u8fc7\u8def\u7531\u5668\u6216\u9632\u706b\u5899\u65f6\u4fee\u6539IP\u5730\u5740\u7684\u6280\u672f\u3002\u5176\u4e3b\u8981\u76ee\u7684\u662f\u89e3\u51b3IPv4\u5730\u5740\u77ed\u7f3a\u95ee\u9898&#xff0c;\u540c\u65f6\u63d0\u4f9b\u4e00\u5b9a\u7a0b\u5ea6\u7684\u7f51\u7edc\u5b89\u5168\u3002<\/p>\n<p>NAT\u7684\u5de5\u4f5c\u673a\u5236<\/p>\n<p>NAT\u8bbe\u5907&#xff08;\u5982\u8def\u7531\u5668&#xff09;\u5728\u5185\u90e8\u7f51\u7edc\u548c\u5916\u90e8\u7f51\u7edc\u4e4b\u95f4\u5145\u5f53\u4e2d\u95f4\u4eba\u3002\u5185\u90e8\u7f51\u7edc\u4f7f\u7528\u79c1\u6709IP\u5730\u5740&#xff08;\u5982192.168.x.x&#xff09;&#xff0c;\u800c\u5916\u90e8\u7f51\u7edc\u4f7f\u7528\u516c\u6709IP\u5730\u5740\u3002\u5f53\u5185\u90e8\u8bbe\u5907\u8bbf\u95ee\u5916\u90e8\u7f51\u7edc\u65f6&#xff0c;NAT\u8bbe\u5907\u4f1a\u5c06\u79c1\u6709IP\u5730\u5740\u66ff\u6362\u4e3a\u516c\u6709IP\u5730\u5740\u3002<\/p>\n<p>\u6570\u636e\u5305\u4ece\u5185\u90e8\u7f51\u7edc\u53d1\u51fa\u65f6&#xff0c;NAT\u8bbe\u5907\u4f1a\u8bb0\u5f55\u6e90IP\u5730\u5740\u548c\u7aef\u53e3\u53f7&#xff0c;\u5e76\u5c06\u5176\u6620\u5c04\u5230\u4e00\u4e2a\u516c\u6709IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u3002\u5916\u90e8\u670d\u52a1\u5668\u54cd\u5e94\u65f6&#xff0c;NAT\u8bbe\u5907\u6839\u636e\u6620\u5c04\u8868\u5c06\u54cd\u5e94\u8f6c\u53d1\u5230\u6b63\u786e\u7684\u5185\u90e8\u8bbe\u5907\u3002<\/p>\n<p>\u57fa\u672c\u4ee5\u4e0a\u8fd9\u4e9b\u662f\u4e86\u89e3&#xff0c;\u60f3\u8981\u66f4\u6df1\u5165\u7684\u5256\u6790\u8fd9\u4e2aNAT\u53ef\u4ee5\u81ea\u884c\u94bb\u7814\u3002\u7814\u7a76\u51fa\u6765\u8bb0\u5f97\u5206\u4eab\u51fa\u6765\u8ba9\u6211\u4e5f\u5b66\u5b66\u3002<\/p>\n<h3>\u67e5\u770b\u7f51\u7edcIP\u548c\u7f51\u5173<\/h3>\n<p>Windows\u7cfb\u7edf&#xff08;\u547d\u4ee4\u884c&#xff09; \u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26&#xff08;Win&#043;R&#xff0c;\u8f93\u5165cmd&#xff09;&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>ipconfig \u8f93\u51fa\u4e2d\u67e5\u627e\u201cIPv4\u5730\u5740\u201d\u5373\u4e3a\u672c\u5730IP&#xff0c;\u201c\u9ed8\u8ba4\u7f51\u5173\u201d\u5373\u4e3a\u7f51\u5173\u5730\u5740\u3002<\/p>\n<p>Linux\u7cfb\u7edf ifconfig \u67e5\u770bIP&#xff08;\u9700\u5b89\u88c5net-tools&#xff09;\u3002<\/p>\n<h4>\u7f51\u7edc\u914d\u7f6e\u5b9e\u4f8b<\/h4>\n<p>\u8bbe\u7f6e\u6307\u5b9aIP\u5730\u5740\u5728Linux\u7cfb\u7edf\u4e2d \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6<\/p>\n<p><span class=\"token function\">vi<\/span> \/etc\/sysconfig\/network-scripts\/ifcfg-ens33<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072119-685a51ef73124.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u518d\u5230Linux\u4e2d\u70b9\u51fb\u7f16\u8f91&#xff0c;\u8fdb\u5165\u865a\u62df\u7f51\u7edc\u7f16\u8f91\u5668&#xff0c;\u627e\u5230v8 Nat\u6a21\u5f0f\u4e0b&#xff0c;\u4fee\u6539ip\u4e3a192.168.200.0<\/p>\n<p>\u6700\u540e\u91cd\u542f\u670d\u52a1\u6216\u8005\u91cd\u542f\u7cfb\u7edf<\/p>\n<p>service network restart reboot<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>Linux \u670d\u52a1\u5668\u7684\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e\u6d89\u53ca\u4f17\u591a\u547d\u4ee4\u4e0e\u7ec6\u8282&#xff0c;\u4e0d\u4ec5\u8981\u719f\u6089\u4e0d\u540c\u53d1\u884c\u7248\u7684\u5dee\u5f02&#xff0c;\u8fd8\u5f97\u7ed3\u5408\u5b9e\u9645\u573a\u666f\u7075\u6d3b\u8fd0\u7528&#xff0c;\u6bcf\u4e00\u6b21\u603b\u7ed3\u90fd\u662f\u7ecf\u9a8c\u4e0e\u77e5\u8bc6\u7684\u6c89\u6dc0&#xff0c;\u80cc\u540e\u7684\u52aa\u529b\u53ef\u60f3\u800c\u77e5&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb940\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf59\u6b21\u3002Linux \u670d\u52a1\u5668\u7684\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e\u6d89\u53ca\u4f17\u591a\u547d\u4ee4\u4e0e\u7ec6\u8282\uff0c\u4e0d\u4ec5\u8981\u719f\u6089\u4e0d\u540c\u53d1\u884c\u7248\u7684\u5dee\u5f02\uff0c\u8fd8\u5f97\u7ed3\u5408\u5b9e\u9645\u573a\u666f\u7075\u6d3b\u8fd0\u7528\uff0c\u6bcf\u4e00\u6b21\u603b\u7ed3\u90fd\u662f\u7ecf\u9a8c\u4e0e\u77e5\u8bc6\u7684\u6c89\u6dc0\uff0c\u80cc\u540e\u7684\u52aa\u529b\u53ef\u60f3\u800c\u77e5\uff01<\/p>\n","protected":false},"author":2,"featured_media":45344,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,4286,43,44],"topic":[],"class_list":["post-45351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-4286","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/45351.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb940\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf59\u6b21\u3002Linux \u670d\u52a1\u5668\u7684\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e\u6d89\u53ca\u4f17\u591a\u547d\u4ee4\u4e0e\u7ec6\u8282\uff0c\u4e0d\u4ec5\u8981\u719f\u6089\u4e0d\u540c\u53d1\u884c\u7248\u7684\u5dee\u5f02\uff0c\u8fd8\u5f97\u7ed3\u5408\u5b9e\u9645\u573a\u666f\u7075\u6d3b\u8fd0\u7528\uff0c\u6bcf\u4e00\u6b21\u603b\u7ed3\u90fd\u662f\u7ecf\u9a8c\u4e0e\u77e5\u8bc6\u7684\u6c89\u6dc0\uff0c\u80cc\u540e\u7684\u52aa\u529b\u53ef\u60f3\u800c\u77e5\uff01\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/45351.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-24T07:21:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072118-685a51eee53fd.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45351.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/45351.html\",\"name\":\"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-24T07:21:20+00:00\",\"dateModified\":\"2025-06-24T07:21:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/45351.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/45351.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45351.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/45351.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb940\u6b21\uff0c\u70b9\u8d5e52\u6b21\uff0c\u6536\u85cf59\u6b21\u3002Linux \u670d\u52a1\u5668\u7684\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e\u6d89\u53ca\u4f17\u591a\u547d\u4ee4\u4e0e\u7ec6\u8282\uff0c\u4e0d\u4ec5\u8981\u719f\u6089\u4e0d\u540c\u53d1\u884c\u7248\u7684\u5dee\u5f02\uff0c\u8fd8\u5f97\u7ed3\u5408\u5b9e\u9645\u573a\u666f\u7075\u6d3b\u8fd0\u7528\uff0c\u6bcf\u4e00\u6b21\u603b\u7ed3\u90fd\u662f\u7ecf\u9a8c\u4e0e\u77e5\u8bc6\u7684\u6c89\u6dc0\uff0c\u80cc\u540e\u7684\u52aa\u529b\u53ef\u60f3\u800c\u77e5\uff01","og_url":"https:\/\/www.wsisp.com\/helps\/45351.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-24T07:21:20+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250624072118-685a51eee53fd.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/45351.html","url":"https:\/\/www.wsisp.com\/helps\/45351.html","name":"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-24T07:21:20+00:00","dateModified":"2025-06-24T07:21:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/45351.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/45351.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/45351.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux \u670d\u52a1\u5668\u8fd0\u7ef4\uff1a\u78c1\u76d8\u7ba1\u7406\u4e0e\u7f51\u7edc\u914d\u7f6e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=45351"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45351\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/45344"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=45351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=45351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=45351"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=45351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}