{"id":563,"date":"2021-10-09T04:01:00","date_gmt":"2021-10-09T04:01:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=563"},"modified":"2021-10-09T04:01:00","modified_gmt":"2021-10-09T04:01:00","slug":"563","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/10\/09\/563\/","title":{"rendered":"Linux Debian 11 \u7f51\u7edc\u8bbe\u7f6e: \u66f4\u6362\u786c\u4ef6\u540e\u7f51\u5361\u4e0d\u540c\uff0c\u4e0d\u80fd\u5206\u914dIP\u4fee\u590d"},"content":{"rendered":"<p>linux.webp<\/p>\n<h2>Debian 11 \u9ed8\u8ba4\u5b89\u88c5\u4e86N\u591a\u7f51\u5361\u9a71\u52a8: realtek intel \u7b49\u4e3b\u8981\u786c\u4ef6\u5382\u5546\u7f51\u5361<\/h2>\n<pre><code>$ ls \/lib\/modules\/5.10.0-8-amd64\/\/kernel\/drivers\/net\/ethernet\/\n\n3com     agere     amd       broadcom  chelsio  dlink     fujitsu  intel\nmellanox   myricom    netronome      qlogic    sfc    smsc    tehuti    xircom\n8390     alteon  aquantia  brocade   cisco    emulex     google\njme.ko   micrel     natsemi    nvidia           rdc    silan  stmicro    ti\nadaptec  amazon  atheros   cavium    dec      fealnx.ko  huawei\nmarvell  microchip  neterion    packetengines  realtek    sis    sun    via\n\n$ lspci | grep Ethernet\n00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)\n\n$ lsmod\ne1000                 155648  0<\/code><\/pre>\n<ul>\n<li>\u67e5\u770b\u7f51\u5361\u9a71\u52a8\u652f\u6301\u5382\u5bb6\uff0c\u67e5\u770b\u7f51\u5361\u8bbe\u5907\uff0c<code>Intel Corporation 82540EM Gigabit<\/code><\/li>\n<li>\u865a\u62df\u673a\u7f51\u5361\u9a71\u52a8\u9ed8\u8ba4 <code>e1000<\/code> \uff0c\u9a71\u52a8\u6587\u4ef6 <code>intel\/e1000\/e1000.ko<\/code><\/li>\n<\/ul>\n<h3>\u865a\u62df\u673a\u8bbe\u7f6e\u597d\u4e86\uff0c\u653e\u5230\u5b9e\u4f53\u673a\u8fd0\u884c\uff0c\u6216\u8005\u5176\u4ed6\u865a\u62df\u7cfb\u7edf\u91cc\u8fd0\u884c\uff0c\u5927\u591a\u80fd\u76f4\u63a5\u9a71\u52a8\u4f7f\u7528\uff0c\u53ea\u8981\u4fee\u6539\u4e0b\u7f51\u7edc\u914d\u7f6e\u5c31\u53ef\u4ee5<\/h3>\n<p>ifup.png<\/p>\n<pre><code>ip addr      # \u67e5\u770b\u6709\u6ca1\u6b63\u786e\u5206\u914dIP\u548c\u7f51\u5361\u8bc6\u522b\u8bbe\u5907\u540d\ncat \/etc\/network\/interfaces  # \u67e5\u770b\u7f51\u7edc\u914d\u7f6e\uff0c\u914d\u7f6e\u7f51\u5361\u540d\u548c\u5b9e\u9645\u662f\u5426\u6709\u533a\u522b\nsed -i s\/enp2s0\/enp0s3\/g   \/etc\/network\/interfaces    # \u66ff\u6362\u914d\u7f6e\u4e2d\u6b63\u786e\u7684\u7f51\u5361\u540d\nifup enp0s3    # \u91cd\u65b0\u52a0\u8f7d\u7f51\u5361\u914d\u7f6e\uff0c\u5206\u914dIP<\/code><\/pre>\n<ul>\n<li>\u4f7f\u7528\u4ee5\u4e0a4\u547d\u4ee4\u53ef\u4ee5\u7528\u6765\u6b63\u786e\u914d\u7f6e\u7f51\u5361<\/li>\n<\/ul>\n<h2>\u81ea\u52a8\u8bbe\u7f6e: <code>autonet.sh<\/code>  \u81ea\u52a8\u4fee\u6539interfaces \u7f51\u5361\u81ea\u52a8\u52a0\u8f7d<\/h2>\n<ul>\n<li>\n<p>\u53ef\u4ee5\u9884\u5148\u4e0b\u8f7d\u811a\u672c  <a href=\"https:\/\/lyvba.com\/autonet.sh\">autonet.sh<\/a><\/p>\n<pre><code>wget https:\/\/lyvba.com\/autonet.sh\nbash  autonet.sh\n\"\"\"\"\n![autonet.png][3]<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6216\u8005\u7f16\u8f91 <code>autonet.sh<\/code> \u811a\u672c\u590d\u5236\u7c98\u8d34<\/p>\n<pre><code>#!\/bin\/bash\n# autonet.sh  \u81ea\u52a8\u4fee\u6539interfaces \u7f51\u5361\u81ea\u52a8\u52a0\u8f7d<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>lspci | grep Ethernet<br \/>ni=$(ip addr | grep -E en[a-zA-Z0-9] | head -n 1 | awk -F ': '  '{print $2}')<br \/>sed -i <code>s\/enp[a-zA-Z0-9]*\/${ni}\/g<\/code>  \/etc\/network\/interfaces<br \/>ifup $ni<\/p>\n<pre><code>\n  [1]: https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/1039932293.webp\n  [2]: https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/688226075.png<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>linux.webp Debian 11 \u9ed8\u8ba4\u5b89\u88c5\u4e86N\u591a\u7f51\u5361\u9a71\u52a8: realtek intel \u7b49\u4e3b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=563"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/563\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}