想要添加一個網卡,按照網上的一些資料說是修改 /etc/netplan/下的yaml檔案就可以
修改完如下所示:
# Let NetworkManager manage all devices on this system
network:
#version: 2
#renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.68.140/24]
nameservers:
addresses: [8.8.8.8,8.8.4.4]
eth1:
dhcp4: no
dhcp6: no
addresses: [192.168.68.142/24]
gateway4: 192.168.68.140
nameservers:
addresses: [8.8.8.8,8.8.4.4]
version: 2
輸入命令 sudo netplan apply 后ens33網卡ip地址被修改了,但沒有eth1網卡,
輸入命令 ifconfig eth1 up 時報錯 eth1: 獲取介面標志時出錯: 沒有那個設備
按照傳統的方法修改 、etc/network/interface 檔案
輸入 sudo /etc/init.d/networking restart 后報錯:
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because th
e control process exited with error code.See "systemctl status networking.service" and "journalctl -xe" for details.
failed!
輸入systemctl status networking.service后結果如下
networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-06-12 16:20:58 CST; 39s ago
Docs: man:interfaces(5)
Process: 11719 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCESS)
Process: 12019 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 12016 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-envir
Main PID: 12019 (code=exited, status=1/FAILURE)
6月 12 16:20:57 server-virtual-machine systemd[1]: Starting Raise network interfaces...
6月 12 16:20:57 server-virtual-machine ifup[12019]: Cannot find device "eth0"
6月 12 16:20:57 server-virtual-machine ifup[12019]: Failed to bring up eth0.
6月 12 16:20:58 server-virtual-machine ifup[12019]: Cannot find device "eth1"
6月 12 16:20:58 server-virtual-machine ifup[12019]: Failed to bring up eth1.
6月 12 16:20:58 server-virtual-machine systemd[1]: networking.service: Main process exited, code=exited, sta
6月 12 16:20:58 server-virtual-machine systemd[1]: networking.service: Failed with result 'exit-code'.
6月 12 16:20:58 server-virtual-machine systemd[1]: Failed to start Raise network interfaces.
求大佬指點如何添加第二塊網卡
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/24313.html
標籤:專題技術討論區
上一篇:大佬們 小問題 檔案管理,展示目錄下的檔案,查看檔案內容
下一篇:救急
