\r\ndefault via 192.168.0.1 dev wlp58s0 proto dhcp metric 600\r\n169.254.0.0\/16 dev wlp58s0 scope link metric 1000\r\n192.168.0.0\/24 dev wlp58s0 proto kernel scope link src 192.168.0.106 metric 600\r\n<\/pre>\n\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\uff0c\u6ce8\u610f default \u5f00\u5934\u7684\u90a3\u4e00\u884c\uff0c\u540e\u9762\u8ddf\u7684\u5c31\u662f\u9ed8\u8ba4\u7f51\u5173 IP \u5730\u5740\u3002
\n\u6216\u8005\uff0c\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u547d\u4ee4\u4e0e grep \u7ed3\u5408\u4f7f\u7528\uff1a<\/p>\n
\r\nip route | grep default\r\n<\/pre>\n\u8fd9\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u53ea\u4f1a\u7ed9\u51fa\u9ed8\u8ba4\u7f51\u5173 IP\uff1a<\/p>\n
\r\ndefault via 192.168.0.1 dev wlp1s0 proto dhcp metric 600\r\n<\/pre>\n\u5982\u4e0a\u6240\u793a\uff0c192.168.0.1 \u5373\u4e3a\u6211\u4eec\u4f8b\u5b50\u4e2d\u7684\u9ed8\u8ba4\u7f51\u5173 IP\u3002<\/p>\n
\u67e5\u627e\u7f51\u5173IP\u5730\u5740\u7684\u5176\u4ed6\u65b9\u6cd5 <\/strong><\/div>\nLinux \u4e2d\u7684 ip \u547d\u4ee4\u63d0\u4f9b\u4e86\u5927\u591a\u6570\u7f51\u7edc\u76f8\u5173\u7684\u64cd\u4f5c\uff0c\u5982\u679c\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684 Linux \u7cfb\u7edf\uff0c\u6211\u4eec\u53ef\u80fd\u5c31\u4f1a\u6ce8\u610f\u5230\uff0c\u8981\u5b8c\u6210\u67d0\u4ef6\u4e8b\u60c5\uff0c\u4e00\u822c\u4f1a\u6709\u591a\u79cd\u4e0d\u540c\u7684\u65b9\u6cd5\u3002\u6240\u4ee5\uff0c\u8981\u67e5\u770b\u9ed8\u8ba4\u7f51\u5173\uff0c\u8fd8\u6709\u5176\u4ed6\u7684\u4e00\u4e9b\u65b9\u6cd5\uff0c\u6bd4\u5982\u4f7f\u7528\u5176\u4ed6\u7f51\u7edc\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u770b\u4e00\u4e0b\u3002<\/p>\n
\u4f7f\u7528 route \u547d\u4ee4\u67e5\u8be2\u7f51\u5173\u5730\u5740 <\/strong><\/span><\/div>\n\u6211\u4eec\u53ef\u4ee5\u5728 route \u547d\u4ee4\u4e2d\u4f7f\u7528 -n \u9009\u9879\u6765\u663e\u793a\u5305\u542b IP \u5730\u5740\u7684\u8def\u7531\u8868\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n
\r\nroute -n\r\n<\/pre>\n\u8f93\u51fa\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n
\r\nKernel IP routing table\r\nDestination Gateway Genmask Flags Metric Ref Use Iface\r\n0.0.0.0 192.168.0.1 0.0.0.0 UG 600 0 0 wlp58s0\r\n169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp58s0\r\n192.168.0.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp58s0\r\n<\/pre>\n\u6ce8\u610f\u5230\u5176\u4e2d\u7684 U \u548c G \u6807\u5fd7\u4e86\u5417\uff1fU \u8868\u793a\u8def\u7531\u201c\u5411\u4e0a\u201d\uff0cG \u8868\u793a\u5b83\u662f\u7f51\u5173\u3002<\/p>\n
\u4f7f\u7528 netstat \u547d\u4ee4\u67e5\u8be2\u7f51\u5173 <\/strong><\/span><\/div>\n\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528 netstat \u547d\u4ee4\u663e\u793a\u7ec4\u6210\u7f51\u5173\u7684\u8def\u7531\u8868\uff0c\u4ee5\u6b64\u6765\u83b7\u53d6\u7f51\u5173\u5730\u5740\u3002\u770b\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n
\r\nnetstat -r -n\r\n<\/pre>\n\u5176\u8f93\u51fa\u4e0e route \u547d\u4ee4\u7684\u8f93\u51fa\u76f8\u540c\uff1a<\/p>\n
\r\nKernel IP routing table\r\nDestination Gateway Genmask Flags MSS Window irtt Iface\r\n0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlp58s0\r\n169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlp58s0\r\n192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp58s0\r\n<\/pre>\n\u53ef\u4ee5\u901a\u8fc7 G \u6807\u5fd7\u6765\u627e\u5230\u7f51\u5173\u5730\u5740\u3002\u4ee5\u4e0a\u5c31\u662f\u6211\u4eec\u672c\u6b21\u5206\u4eab\u7684\u5173\u4e8e\u83b7\u53d6\u9ed8\u8ba4\u7f51\u5173\u7684\u76f8\u5173\u5185\u5bb9\uff0c\u6b22\u8fce\u7559\u8a00\u8ba8\u8bba\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7f51\u5173\u662f\u4e24\u4e2a\u7f51\u7edc\u4e4b\u95f4\u7684\u5165\u53e3\uff0c\u8def\u7531\u5668\u5c31\u662f\u7f51\u5173\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002\u4f60\u7684\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u6d41\u91cf\u90fd\u662f\u6d41\u5411\u8def\u7531\u5668\uff0c\u7136\u540e\u518d\u901a\u8fc7\u8def\u7531\u5668\u6d41\u5411\u4e92 […]<\/p>\n","protected":false},"author":643,"featured_media":257570,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-257567","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=257567"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257567\/revisions"}],"predecessor-version":[{"id":257569,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257567\/revisions\/257569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/257570"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=257567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=257567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=257567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}