vm 14 Pro 多台Ubuntu 18.04服务器固定IP设置

需求:

    因多台服务器需固定IP,防止关机后IP变化,需固定IP地址

系统环境:

    虚拟机 :  VMware® Workstation 14 Pro 14.1.2 build-8497320

     系统:Ubuntu 18.04

设置:

虚拟机网络设置使用默认即可

    1、查看ubuntu版本:

cat /etc/issue


   2、查看网卡名称:

ip a

3、 进入 50-cloud-init.yaml 设置
vi   /etc/netplan/50-cloud-init.yaml

 ###个人设置

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            addresses: [192.168.152.132/24]
            dhcp4: true
            optional: true
    version: 2

其中addresses 中设置的IP值为本次设置的固定IP值

 命令操作

i     - -编辑
:wq   - -保存
:exit - -退出

4、编辑保存后执行

sudo netplan apply

5、执行ifconfig查询ip

ifconfig


6、ping www.baidu.com 测试网络

ping www.baidu.com



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值