{"id":254921,"date":"2022-10-21T08:17:46","date_gmt":"2022-10-21T00:17:46","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=254921"},"modified":"2022-10-20T12:18:11","modified_gmt":"2022-10-20T04:18:11","slug":"linux-find-ip","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-find-ip.html","title":{"rendered":"\u5728 Linux \u547d\u4ee4\u884c\u4e2d\u67e5\u627e IP \u5730\u5740\u4ecb\u7ecd"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u51e0\u5e74\u524d\uff0cifconfig \u662f Linux \u4e2d\u6700\u53d7\u6b22\u8fce\u7684\u67e5\u8be2\u672c\u673a IP \u5730\u5740\u7684\u65b9\u6cd5\u3002\u4f46\u662f\u73b0\u5982\u4eca ifconfig \u547d\u4ee4\u5df2\u7ecf\u88ab\u542f\u7528\u4e86\u3002\u5728\u67d0\u4e9b Linux \u53d1\u884c\u7248\u4e0a\u5df2\u7ecf\u4e0d\u7528\u4e86\u3002\u90a3\u4e48\uff0c\u9664\u6b64\u4ee5\u5916\u8fd8\u6709\u4ec0\u4e48\u522b\u7684\u65b9\u5f0f\u6765\u67e5\u8be2 IP \u5730\u5740\u5462\uff1f\u4eca\u5929\u6211\u4eec\u5c31\u6765\u4e86\u89e3\u4e00\u4e0b\u8fd9\u4e2a\u95ee\u9898\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u5728 Linux \u547d\u4ee4\u884c\u4e2d\u67e5\u627e IP \u5730\u5740<\/strong><\/div>\n \u73b0\u5728\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0ip\u00a0\u547d\u4ee4\u6765\u67e5\u8be2 IP \u5730\u5740\u3002ip \u547d\u4ee4\u662f\u901a\u7528\u7684\uff0c\u53ef\u4ee5\u7528\u4e8e\u7f51\u7edc\u76f8\u5173\u7684\u5176\u4ed6\u4e00\u4e9b\u4e8b\u60c5\u3002<\/p>\n \u4e0d\u8fc7\uff0c\u8981\u663e\u793a IP \u5730\u5740\uff0c\u53ef\u4ee5\u4f7f\u7528 ip addr\uff0cip a \u6216\u8005 ip address\uff0c\u5982\u4e0b\u6240\u793a\u547d\u4ee4\uff1a<\/p>\n 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\r\nlink\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\ninet 127.0.0.1\/8 scope host lo\r\nvalid_lft forever preferred_lft forever\r\ninet6 ::1\/128 scope host\r\nvalid_lft forever preferred_lft forever\r\n2: wlp58s0: mtu 1500 qdisc mq state UP group default qlen 1000\r\nlink\/ether 9c:b6:d0:d0:fc:b5 brd ff:ff:ff:ff:ff:ff\r\ninet 192.168.1.20\/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp58s0\r\nvalid_lft 5962sec preferred_lft 5962sec\r\ninet6 fe80::bf14:21e3:4223:e5e4\/64 scope link noprefixroute\r\nvalid_lft forever preferred_lft forever<\/pre>\n |