Kali 获取不到 eth0 网卡的解决方案
2024-05-07 15:32:001092浏览
如果你使用 Kali 的过程中,遇到了 Kali 没有网络,并且通过 ifconfig 命令显示的网卡列表中缺少 eth0 网卡,那么可以参考本文的方法尝试解决。

一、问题现象

  1. 1.
    Kali 的网络图标显示没网

image


  1. 2.
    使用 ifconfig 命令查看,没有 eth0 网卡的信息

image




二、解决方案

  1. 1.
    使用 root 账户登录 Kali

image


  1. 2.
    编辑 Kali 网络配置文件
    在终端输入命令:
    xdg-open /etc/network/interfaces
    这个命令会打开一个编辑器:

image



在里面添加如下内容:
auto eth0 iface eth0 inet dhcp
然后按 Ctrl + S 快捷键保存,关闭编辑器。

  1. 3.
    重启网络
    命令是
    service networking restart
    如无意外,重新执行 ifconfig 命令的时候就可以看到 eth0 网卡了:

image



如果还不行的话可以执行
ifconfig eth0 up
直接指定启动 eth0 网卡。


.milkdown{ tab-size: 4; position: relative; margin-left: auto; margin-right: auto; box-sizing: border-box; color: rgba(46, 52, 64, 0.87); background: rgb(255, 255, 255); } .milkdown .editor { outline: none; } .milkdown .editor .heading { margin: 20px 0px; font-weight: 400; } .milkdown .editor h1 { font-size: 48px; line-height: 1.167; } .milkdown .editor h2 { font-size: 40px; line-height: 1.2; } .milkdown .editor h3 { font-size: 34px; line-height: 1.05; } .milkdown .editor h4 { font-size: 28px; line-height: 1.14; } .milkdown .editor h5 { font-size: 24px; line-height: 1; } .milkdown .editor h6 { font-size: 20px; line-height: 1; } .milkdown .editor .code-fence{ background-color: rgb(236, 239, 244); color: rgb(46, 52, 64); font-size: 14px; border-radius: 4px; } .milkdown .editor .code-fence pre code { line-height: 1.5; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; background-color: rgb(236, 239, 244); font-size: 16px; color: #999; position: relative; text-align: justify; word-break: break-all; display: block; } .milkdown .editor .tableWrapper { overflow-x: auto; margin: 0px; width: 100%; } .milkdown .editor .tableWrapper * { margin: 0px; box-sizing: border-box; font-size: 16px; } .milkdown .editor table { border-collapse: collapse; table-layout: fixed; width: 100%; overflow: auto; border-radius: 4px; } .milkdown .editor tr { border-bottom: 1px solid rgb(216, 222, 233); } .milkdown .editor th { background: rgba(236, 239, 244, 0.5); font-weight: 400; } .milkdown .editor td, .milkdown .editor th { padding: 0px 16px; box-sizing: border-box; position: relative; min-width: 100px; border: 1px solid rgb(216, 222, 233); text-align: left; line-height: 3; height: 48px; vertical-align: middle; } .milkdown .editor p { font-size: 16px; line-height: 1.5; letter-spacing: 0.5px; padding-bottom: 0; margin-bottom: 0; } .milkdown .editor blockquote { padding-left: 12px; line-height: 28px; border-left: 4px solid rgb(94, 129, 172); margin-left: 0px; margin-right: 0px; } .milkdown .editor > * { margin: 20px 0px; margin-right: 0px; margin-left: 0px; } .milkdown .editor .list-item { display: flex; } .milkdown .editor .list-item, .milkdown .editor .task-list-item { margin-top: 8px; } .milkdown .editor ul, .milkdown .editor ol { padding: 0px; } .milkdown .editor .list-item[data-list-type="bullet"] > .list-item_label { font-size: 24px; line-height: 1; } .milkdown .editor .list-item_label { display: flex; -webkit-box-pack: center; justify-content: center; width: 24px; height: 24px; font-size: 16px; line-height: 1.5; color: rgb(94, 129, 172); } .milkdown .editor .list-item_label, .milkdown .editor .list-item .paragraph { margin: 0px; } .milkdown .editor .list-item_body { flex: 1 1 0%; } .milkdown .editor .code-inline { background-color: rgb(46, 52, 64); color: rgb(236, 239, 244); border-radius: 4px; font-weight: 500; font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace; padding: 0px 3px; display: inline; } .milkdown .editor .link, .milkdown .editor a { color: rgb(0, 96, 192); cursor: pointer; transition: all 0.4s ease-in-out 0s; font-weight: 500; } .milkdown .editor .strike-through { text-decoration-color: #000; } .milkdown pre{ color: inherit; } [data-label="image"]{ display:none; }

友情链接: