kali linux重啟網卡失敗:Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details. 問題排查


linux菜雞的時候,總是為了配置網絡而煩惱,重啟網卡的原因有很多,我這次是因為配置了固定IP【使用第三方工具連接】所以需要重啟網卡,出現 Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details,網上搜索了一大堆,發現是自己的問題,下面一個個開始排查,centos網卡配置固定IP的可以參考此鏈接:https://www.cnblogs.com/pandana/p/15013554.html

1.首先重啟網卡 systemctl restart networking 出現如下故障

未修改之前的樣子:

 2.解決方案【兩個配置文件信息錯誤】,第一個文件是 /etc/network/interfaces【管理IP配置】,第二個文件是 /etc/resolv.conf【管理DNS】,首先查看當前的網卡信息 ifconfig 命令,如下圖當前IP地址為192.168.190.137

 3.解決第一個配置文件問題,鍵入命令gedit /etc/network/interfaces【使用gedit是以文本編輯器的形式打開,方便菜雞對vi和vim是不熟練】

 可以看到,上面的 interfaces 配置文件錯漏百出,怎么可能重啟網絡服務,只能使用當前DHCP的服務了,固定ip無法配置,下面開始解決問題

①把etho【字母o】改為eth0【數字0】

②把當前的address 192.168.139.130改為192.168.190.137【當然你這里可以亂改,只要是192.168.190網段就行,具體的看個人配置,我這里改為ifconfig的就行】

③吧當前的gateway 192.168.139.1改為192.168.190.2,如何查看網關地址,如下圖,先點擊虛擬機菜單欄的1編輯——2虛擬機編輯器【因為我選擇的是NAT模式,子網的網段為192.168.190,橋接模式需要點擊右下角的更改配置】——3NAT設置

可以看見當前的默認網關為192.168.190.2,你也可以修改,但是我這里就不操作了。修改完成后點擊右上角的Save保存然后右上角小叉退出即可

 為了方便水友們打錯了,把etc/network/interfaces配置文件貼上,修改具體參數就行

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.190.137
netmask 255.255.255.0
gateway 192.168.190.2

 4.修改第二個配置文件,配置DNS服務的,鍵入命令 gedit /etc/resolv.conf

 可以加一個外網的谷歌DNS進入,當然也可以不加,加完就保存退出。

# Generated by NetworkManager
search localdomain
nameserver 192.168.190.2
nameserver 8.8.8.8

5.兩個文件修改完畢,開始重啟網卡配置,命令 systemctl restart networking,發現還是不行!!不要慌,重啟kali即可,鍵入reboot命令重啟服務

 重啟之后,網絡的IP地址固定下來了,當前ip確實為剛才修改的靜態ip地址192.168.190.137,且重啟網卡命令systemctl restart networking不再出錯;

注:如果reboot重啟之后還是出現無法獲取IP的行為,那就,,,,,那就證明你的/etc/network/interfaces配置文件錯了,麻煩你再認真看一遍!!!!!

 

最后,如果還是不行,麻煩你私信我,我就不信邪了,,,,。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Linux 重啟網卡失敗 Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. docker 啟動失敗 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. 啟動Nginx服務失敗:Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. Job for dhcpd.service failed because the control process exited with error code. See "systemctl status dhcpd.service" and "journalctl -xe" for details.問題 linux----------啟動network的時候報錯Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. centos7啟動MySQL報 Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details. Jenkins報錯:Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details. Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM