一、静态分配固定IP

kuaibang@k8smaster:~$ sudo nano  /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens160:
addresses:
- 192.168.1.155/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
search:
- localhost
version: 2

说明:

1、ens160        网卡名称(配置的网卡名称要和修改的一样)

2、addresses      固定IP

3、gateway4       网关

4、nameservers    设置DNS

二、dhcp自动分配IP

kuaibang@k8smaster:~$ sudo nano /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp2s0:
dhcp4: true
version: 2 

三、使其配置文件生效

sudo netplan apply

四、查看是否生效

ifconfig

最新文章

  1. 部署wcf到IIS时的问题
  2. 作业七:团队项目——Alpha版本冲刺阶段010
  3. Mapped Statements collection does not contain value fo
  4. 据说最近IMO中国队失利的一题
  5. Smart210学习记录------nor flash驱动
  6. 'dict' object has no attribute 'a'
  7. C++读入两个参数
  8. 为CentOS 加入�本地源
  9. IOS的 testflight测试设置
  10. jQuery----blur()方法
  11. C#中给线程传值并启动
  12. adb server is out of date.
  13. MySQL错误:You are using safe update mode and you tried to update a table without a WHERE that uses a K
  14. Android 7.0 Power 按键处理流程
  15. mysql也有complex view merging 这个特性(5.6 , 5.7)
  16. [OpenCV] 编译源程序 2.4.10 以支持 CUDA
  17. poj 3468 A Simple Problem with Integers(线段树区间更新)
  18. 判断文本是否溢出/hover显示全部
  19. GitHub上个最有意思的项目合集(技术清单系列)
  20. python语法学习之函数、类、模块

热门文章

  1. memoの关于Qt的一些用法记录
  2. Java笔记_this关键字
  3. 前台主页功能-前台轮播图功能完成-git介绍和安装-git使用流程-git常用命令-git忽略文件
  4. java工厂方法模式学习
  5. 19.内容提供者ContentProvider
  6. docker登录Ubuntu出现error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`的解决方法
  7. JS脱敏姓名、身份证、电话、邮箱
  8. jekins 入门
  9. 在idea中查看jar包源码
  10. 【笔记】BootstrapTable带参数刷新数据的坑