ubuntu设置网卡默认启动_ubuntu server 18.04 有线网卡默认关闭,需要手工配置才能使用的方法...

1、安装完ubuntu server 18.04 后,笔记本电脑的有线网卡已经识别了,但是没有ip, 并且插上网线后端口灯不亮。

解决方法:

第一步、配置端口链路状态为 up

# ip link set dev xxx up

第二步、配置网口的静态Ip地址。

ubuntu server 使用netplan 工具进行配置,参考官网配置如下:

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值