{"id":203533,"date":"2020-10-25T08:04:02","date_gmt":"2020-10-25T00:04:02","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=203533"},"modified":"2020-10-22T16:04:18","modified_gmt":"2020-10-22T08:04:18","slug":"ubuntu-ifconfig-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ubuntu-ifconfig-command.html","title":{"rendered":"\u5982\u4f55\u89e3\u51b3Ubuntu\u63d0\u793a\u6ca1\u6709\u627e\u5230ifconfig\u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u6211\u4eec\u65b0\u5b89\u88c5\u7684Ubuntu 20.04\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u60f3\u8981\u67e5\u770bip\u5730\u5740\uff0c\u53d1\u73b0\u4f7f\u7528ifconfig\u547d\u4ee4\uff0c\u63d0\u793a\u627e\u4e0d\u5230\u8fd9\u4e2a\u547d\u4ee4\u3002\u5728\u4e0b\u9762\u6587\u7ae0\u6c47\u603b\uff0c\u4f1a\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u8fd9\u4e2a\u5de5\u5177\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5f53\u5728\u8fd0\u884cifconfig<\/code>\u547d\u4ee4\u662f\uff0c\u63d0\u793a\u4e0b\u9762\u7684\u9519\u8bef\uff0c\u5c31\u4ee3\u8868\u6ca1\u6709\u5b89\u88c5\u5b83\uff1a<\/p>\n

\r\nbob@ubuntu-20-04:~$ ifconfig\r\n\r\nCommand 'ifconfig' not found, but can be installed with:\r\n\r\nsudo apt install net-tools\r\n<\/pre>\n

\u6216\u8005\u63d0\u793a\u4e0b\u9762\u7684\u4fe1\u606f\uff1a<\/p>\n

\r\n-bash: ifconfig: command not found\r\n<\/pre>\n

\u5728Ubuntu 20.04\u4e2d\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528ifconfig\u547d\u4ee4\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4f1a\u6536\u5230\u6709\u5173\u7f3a\u5c11\u7684ifconfig\u547d\u4ee4\u7684\u9519\u8bef\u7684\u539f\u56e0\u3002\u82e5\u60f3\u8981\u67e5\u770bip\u5730\u5740\u3002\u53ef\u4ee5\u4f7f\u7528ip addr<\/code>\u547d\u4ee4\uff0c\u5b83\u51e0\u4e4e\u53ef\u4ee5\u6267\u884c\u4e0eifconfig\u547d\u4ee4\u76f8\u540c\u7684\u4efb\u52a1\uff0c\u5982\u4e0b\u9762\u7684\u4ee3\u7801\u6240\u793a\uff1a<\/p>\n

\r\nbob@ubuntu-20-04:~$ ip addr\r\n1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\r\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n    inet 127.0.0.1\/8 scope host lo\r\n       valid_lft forever preferred_lft forever\r\n    inet6 ::1\/128 scope host \r\n       valid_lft forever preferred_lft forever\r\n2: ens33:  mtu 1500 qdisc fq_codel state UP group default qlen 1000\r\n    link\/ether 00:0c:29:40:d4:6f brd ff:ff:ff:ff:ff:ff\r\n    inet 192.168.43.174\/24 brd 192.168.43.255 scope global dynamic noprefixroute ens33\r\n       valid_lft 1337sec preferred_lft 1337sec\r\n    inet6 fe80::7559:c488:6787:289d\/64 scope link noprefixroute \r\n       valid_lft forever preferred_lft forever\r\n<\/pre>\n

\"\"
\n\u4ece\u4e0a\u9762\u4ee3\u7801\u8f93\u51fa\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u8be5\u547d\u4ee4\u4ecd\u5c06\u663e\u793a\u6240\u6709\u7f51\u7edc\u63a5\u53e3\u7684IP\u5730\u5740\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n

\u5982\u679c\u4e60\u60ef\u4f7f\u7528\u65e7\u7684ifconfig\u547d\u4ee4\uff0c\u5219\u9700\u8981\u5b89\u88c5net-tools<\/code>\u8f6f\u4ef6\u5305\u3002net-tools\u662f\u4e00\u4e2a\u5de5\u5177\u5305\uff0c\u5176\u4e2d\u5305\u542b\u6784\u6210Linux\u7f51\u7edc\u57fa\u7840\u7684\u4e00\u7cfb\u5217\u7a0b\u5e8f\u3002\u8fd9\u4e9b\u5305\u62ec\uff1a<\/p>\n

    \n
  • ifconfig<\/li>\n
  • netstat<\/li>\n
  • dig<\/li>\n
  • hostname<\/li>\n
  • route<\/li>\n
  • arp<\/li>\n
  • iptunnel<\/li>\n<\/ul>\n
    \u89e3\u51b3ifconfig\u547d\u4ee4\u627e\u4e0d\u5230\u7684\u95ee\u9898<\/strong><\/div>\n

    \u8981\u89e3\u51b3\u4ee5\u4e0a\u9519\u8bef\uff0c\u5c31\u9700\u8981\u5b89\u88c5net-tools\u5de5\u5177\u5305\uff1a<\/p>\n

    \r\nbob@ubuntu-20-04:~$ sudo apt install net-tools\r\n<\/pre>\n

    \"\"
    \n\u5b89\u88c5\u6210\u529f\u5b8c\u6210\u540e\uff0c\u518d\u6b21\u5c1d\u8bd5\u8fd0\u884cifconfig\u547d\u4ee4\uff0c\u53ef\u4ee5\u770b\u5230\u719f\u6089\u7684\u9762\u5b54\u4e86\u3002<\/p>\n

    \u603b\u7ed3<\/strong><\/div>\n

    ifconfig\u5df2\u7ecf\u9010\u6e10\u88abip addr\u53d6\u4ee3\u4e86\uff0c\u56e0\u4e3a\u73b0\u5728\u5927\u90e8\u5206\u53d1\u884c\u7248\u672c\uff0c\u6bd4\u5982Centos\\RHEL\u3001Fedora\u3001Ubuntu\u7b49\u7cfb\u7edf\u90fd\u53d6\u6d88\u4e86net-tools\u5de5\u5177\u5305\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u5f53\u5728\u8fd0\u884cifconfig\u547d\u4ee4\u662f\uff0c\u63d0\u793a\u4e0b\u9762\u7684\u9519\u8bef\uff0c\u5c31\u4ee3\u8868\u6ca1\u6709\u5b89\u88c5\u5b83\uff1a bob@ubuntu-20-04:~$ i […]<\/p>\n","protected":false},"author":309,"featured_media":203534,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-203533","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\/203533","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\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=203533"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/203533\/revisions"}],"predecessor-version":[{"id":203537,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/203533\/revisions\/203537"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/203534"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=203533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=203533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=203533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}