随笔 - 633,  文章 - 0,  评论 - 13,  阅读 - 48万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

sudo lshw -class network   :查看本机网卡信息

 

cd /etc/netplan

sudo vim 00-installer-config.yaml

1.配置自动获取ip

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens5:
      dhcp4: true
      dhcp6: true

  version: 2

 

2.配置静态ip

1
2
3
4
5
6
7
8
9
10
11
12
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens5:
      addresses: [192.168.0.105/24]
      gateway4: 192.168.0.1
      dhcp4: no
      dhcp6: no
      nameservers:
              addresses: [8.8.8.8,8.8.4.4]
      optional: true
  version: 2

  

3.配置wifi

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens5:
      addresses: [192.168.0.105/24]
      gateway4: 192.168.0.1
      dhcp4: no
      dhcp6: no
      nameservers:
              addresses: [8.8.8.8,8.8.4.4]
      optional: true
  wifis:
    wlo1:
      addresses: [192.168.0.108/24]
      gateway4: 192.168.0.1
      dhcp4: no
      nameservers:
              addresses: []
              search: []
      access-points:
              "TP-LINK_C307":
                      password: '4001001111'
 
  version: 2

  

 

4.配置完成后,应用命令:

sudo netplan apply

 

 

注:ubuntu 18.4默认不能识别无线,先用有线网络,无线安装可自行查找

 

posted on   大话人生  阅读(794)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2020-04-20 django部署
2020-04-20 django函数定义上传文件路径
点击右上角即可分享
微信分享提示