1、安裝完ubuntu server 18.04 后,筆記本電腦的有線網卡已經識別了,但是沒有ip, 並且插上網線后端口燈不亮。
解決方法:
第一步、配置端口鏈路狀態為 up
# ip link set dev xxx up
第二步、配置網口的靜態Ip地址。
ubuntu server 使用netplan 工具進行配置,參考官網配置如下:
https://ubuntu.com/server/docs/network-configuration
To configure your system to use static address assignment, create a netplan configuration in the file /etc/netplan/99_config.yaml
. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the addresses, gateway4, and nameservers values to meet the requirements of your network.
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
search: [mydomain, otherdomain]
addresses: [10.10.10.1, 1.1.1.1]
The configuration can then be applied using the netplan command.
sudo netplan apply
第三步:配置網口的dns server
# vi /etc/resolv.conf
nameserver: 內容填寫為其他電腦上可以分配的dns server ip.
例如: 101.198.198.198 221.130.33.52