root@ubuntu-MesosMaster-Marathon:~# cat /etc/netplan/-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/-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
ens33:
addresses: [192.168.115.148/]
gateway4: 192.168.115.2
dhcp4: false
nameservers:
addresses: [192.168.115.2]
version:

看文件格式就知道这个文件严格遵守yaml语法格式,需要 使用root权限,设置好之后可以使用如下命令进行即时生效

root@ubuntu-MesosMaster-Marathon:~# netplan apply
root@ubuntu-MesosMaster-Marathon:~# ping baidu.com
PING baidu.com (220.181.57.216) () bytes of data.
bytes from 220.181.57.216 (220.181.57.216): icmp_seq= ttl= time=25.7 ms

[operator]Ubuntu server 18 设置静态IP的更多相关文章

  1. ubuntu下集群设置静态ip

    hadoop集群时,需要固定集群内计算机相互通信之间的ip地址,但是每次进行网络连接后,ip地址都是变换的,我们希望设置一个用于集群内通信的静态ip,即使重启电脑也不会变化,同样希望能够正常的访问互联 ...

  2. Ubuntu Server 12.04 静态IP简洁配置

    PS:很长时间没使用Ubuntu了,刚才安装个Ubuntu Server 12.04做测试.Ubuntu的网络设置跟Redhat系是不一样的,配置IP时发现跟以前的Ubuntu桌面版本也有所不同,记录 ...

  3. 【转】Ubuntu Server 12.04 静态IP简洁配置

    原文网址:http://blog.csdn.net/njchenyi/article/details/8715417 1.配置静态IP地址: # vim /etc/network/interfaces ...

  4. VMWare 安装ubuntu,虚机设置静态IP接入公网

    本文提供的kafka安装配置为Linux(ubuntu-16.04.3) 1.首先安装VMarea(14.0.0 build-6661328) 2.到http://www.ubuntu.org.cn/ ...

  5. ubuntu 15.10 设置静态ip 分配固定ip 设置dns 设置网关 命令行配置ip 固定ip不生效怎么办

    要用到的文件: 配置接口信息 /etc/network/interfaces 配置内容: auto eth0 iface eth0 inet static address 192.168.216.18 ...

  6. Ubuntu 16.04 设置静态IP 注意事项

    目录 查看动态ip下的网络信息 查看默认网关 设置静态网络 查看动态ip下的网络信息 1 ifconifg # 查看网卡信息: 可以看出网口名称为 eno1, 以及子网掩码(mask) 查看默认网关 ...

  7. Ubuntu 14.04 设置静态IP

    使用Network Manager UI界面中指定 手动时,无法保存. 通过修改配置文件解决来此问题.记录以下. 如果输入过密码后,就会出现在这个目录下面, 以如下chinaNet为例 gaojing ...

  8. Ubuntu Server 19配置静态IP

    这个/etc/netplan下默认有个文件50-cloud-init.yaml,直接修改它就行了 sudo vim /etc/netplan/50-cloud-init.yaml 网口名字ens33可 ...

  9. Ubuntu 18 设置静态 IP

    在Ubuntu 18中使用 netplan 命令 首先 cd /etc/netplan/ 找到 *.yaml文件(每个人可能不一样),编辑它 root@waydeserver:/etc/netplan ...

随机推荐

  1. spring boot 测试类

    import org.junit.Test;import org.junit.runner.RunWith;import org.slf4j.Logger;import org.slf4j.Logge ...

  2. 搭建Turbine时,报错误:Property or field 'default' cannot be found on object of type 'com.netflix.appinfo.InstanceInfo'

    Spring Boot + Eureka Server + Hystrix with Turbine: empty turbine.stream 配置的时候遇到了问题: Property or fie ...

  3. Centos 安装golang beego

    刚开始用go和beego,真的还好多不懂~希望对看到的朋友有帮助~ 本人环境:centos 6.3x86_64 1.我在机器上创建了一个用户zww(useradd zww),登录zww(su zww) ...

  4. c语言使用librdkafka库实现kafka的生产和消费实例(转)

    关于librdkafka库的介绍,可以参考kafka的c/c++高性能客户端librdkafka简介,本文使用librdkafka库来进行kafka的简单的生产.消费 一.producer librd ...

  5. plot绘图

    plot绘图 坐标系图(折线图) 折线图用于显示随时间或有序类别的变化趋势 plt.plot(x,y,format_string,**kwargs) y:Y轴数据,列表或数组,必选 x:X轴数据,列表 ...

  6. 微擎系统 微信支付 get_brand_wcpay_request:fail

    支付授权目录问题,有一个是域名加app的

  7. Swagger与SpringMVC整合

    依赖管理   在整合之前,需要把所有使用到的依赖包全部引入.网上很多文章只是简单告诉读者引入swagger-springmvc-1.0.2.jar包,但是随后你发现这远远不够,还需要很多包,如下所示: ...

  8. MySql log_bin

    [MySql log_bin] 1.查看 log_bin 是否启用. 默认情况下,mysql server 不启用 binlog(验证方法1: 执行"show variables" ...

  9. Python+Webdriver,中文前加u是unicode格式编码的意思

    Python+Webdriver写脚本时,对一些输入框赋值会涉及到输入中文,这时需要在中文前加u 举个例子,在用百度搜索时,要在搜索输入框内输入值, 我用的编码格式是utf-8,向输入框内输入值是:d ...

  10. 关于插入date型数据

    create table student (name varchar2(10) not null primary key , enrolldate date not null);//创建student ...