首页 > 系统相关 >ubuntu ens33网卡掉线问题配置系统重启后自动加载网卡驱动

ubuntu ens33网卡掉线问题配置系统重启后自动加载网卡驱动

时间:2022-10-09 09:59:15浏览次数:50  
标签:systemd sudo 掉线 ubuntu 网卡 etc rc local

 

cd /lib/systemd/system

 

进入system目录 找到 rc-local.service 文件

cat rc-local.service
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

可以看到ExecStart指向了/etc/rc.local,去到 etc目录找到rc.local,没有则创建(sudo touch rc.local),添加以下内容:

#!/bin/bash
sudo dhclient ens33

保存后退出。

sudo systemctl enable rc-local
sudo systemctl start rc-local
sudo systemctl status rc-local
sudo systemctl restart rc-local

 

标签:systemd,sudo,掉线,ubuntu,网卡,etc,rc,local
From: https://www.cnblogs.com/brucewen/p/16771087.html

相关文章

  • ubuntu开启远程桌面功能
    本文介绍ubuntu自带的xrdp工具进行远程桌面登陆。第一步:安装vnc服务sudoapt-getinstalltightvncserver1第二步:安装xrdp服务sudoapt-getinstallxrdp1PS:VNC与xrdp服......
  • ubuntu win10链接增加命令
    转载来源:使用Windows远程桌面工具来远程连接控制Ubuntu系统:http://www.safebase.cn/article-258275-1.html介绍有时需要在实际的电脑上安装Ubuntu的操作系统来搭建免费......
  • Ubuntu上配置静态ip
    在Ubuntu12.0.4 上配置静态ip将/etc/network/interfaces文件修改如下:将/etc/resolv.conf 文件修改如下:重启网卡/etc/init.d/networking  stop/etc/init......
  • Ubuntu系统中环境变量设置两种方法,有什么区别?
    什么方法对/etc/profile进行变量的加入,相当于Windows当中的用户变量,另外一个就是~/.bashrc,相当于系统环境变量的设置,那么他们有什么区别?如何进行使用呢?区别与作用:/et......
  • Ubuntu 下安装 redis 并且设置远程登陆和密码
    安装redissudoapt-getinstall-yredis-server更改配置sudovim/etc/redis/redis/redis.conf如果不知道怎么找直接在命令行模式下输入/{你要搜索的东西}......
  • ubuntu中用vscode
    下载vscode终端中输入code运行输入sudoapt-getupdate  sudoapt-getinstallgcc  此报错解决方式:sudorm/var/lib/dpkg/lock-frontend参考:(40条消息)......
  • Ubuntu20.04和22.04离线安装PostgreSQL14
    今天安装Postgresql14遇到一个问题,目标服务器只有内网,内网提供标准的apt仓库,但是因为不能连接外网,所以没法添加第三方仓库,这样安装pg14就成了问题.从pg的官网......
  • Ubuntu部署DNS服务器
    Bind服务1.安装服务aptinstall-ybind92.配置定义域文件vim/etc/bind/named.conf.default-zones'''zone"con.org"{typemaster;file"/etc/bind/d......
  • Ubuntu迁移mysql数据库到新的目录下
    1.先使用下面命令将mysql数据库服务停止:sudosystemctlstopmysql2.迁移到挂载新盘/mnt/data/方式一:sudomv/var/lib/mysql/mnt/data/方式二:sudocp-a/var/l......
  • ubuntu22 安装gcc
    使用aptitude包依赖管理工具代替apt来处理,aptitude软件包管理工具在解决依赖性问题上更有优势,具体使用方法如下:sudoapt-getinstallaptitude,sudoaptitudeinstallgcc......