Ubuntu server 17.04&18.04 静态IP它怎么去设置

文章目录

Ubuntu 17.04 和18.04系统版本启用了新的网络工具netplan,对于命令行配置网络参数跟之前的版本有比较大的差别


之前的版本是在/etc/network/interfaces中修改
新版本使用/etc/netplan/*.yaml


查看系统版本命令
#lsb_release -a

Ubuntu server 17.04&18.04 静态IP它怎么去设置


网卡配置详细举例


测试服务器网卡配置文件详细路径:
/etc/netplan/01-network-manager-all.yaml 
IP信息: 
IP地址:192.168.0.1
掩码:/24
网关:192.168.0.254
DNS: 8.8.8.8 和 8.8.4.4


1.使用vi 编辑配置网卡文件


Vi /etc/netplan/01-network-manager-all.yaml


#Let NetworkManager manage all devices on this system 
network:
version 2

#renderer: NetworkManager
ethernets:
ens33:
addresses: [192.168.0.1/24]
gateway4: 192.168.0.254
nameservers:
addresses: [8.8.8.8,8.8.4.4] 


#网卡文件注释 
ethernets:
ens33: #配置的网卡名称
addresses: [192.168.0.111/24] #设置本机IP及掩码
gateway4: 192.168.0.1 #设置网关
nameservers:
addresses: [8.8.8.8, 8.8.4.4] #设置DNS 

2.网卡配置文件生效的方法 
执行命令 
#netplan apply

此教程来自固定链接:http://www.rakbuluo.com/p18/

原文链接:,转发请注明来源!

发表评论

  • 68 Responses to “Ubuntu server 17.04&18.04 静态IP它怎么去设置”
    • pharmacy online

      <a href="http://canadianpharmacyhub.com/">approved canadian online pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>online pharmacies canada</a>

      回复
    • best canadian mail order pharmacies

      <a href="http://canadianpharmacyhub.com/">canadian online pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>canadian pharmacies online reviews</a>

      回复
    • best online international pharmacies

      <a href="http://canadianpharmacyguru.com/">canada drugs</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian pharmaceuticals online</a>

      回复
    • Yamburce

      Cheers, I value it. <a href=https://www.kamagramama.com>kamagra 100</a> kamagra oral jelly cheap uk
      kamagra jelly: https://www.kamagramama.com kamagra 100

      回复
    • canadian pharmacies that ship to us

      <a href="http://canadianpharmacyguru.com/">best canadian pharcharmy online</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian pharmacies that ship to us</a>

      回复
    • online pharmacies legitimate

      <a href="http://canadianpharmacyfit.com/">overseas online pharmacy</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>canadian pharmacy</a>

      回复
    • legitimate online pharmacies india

      <a href="http://canadianpharmacyfit.com/">canada drugs online</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>pharmacy drugstore online</a>

      回复
    • best canadian online pharmacy

      <a href="http://canadianpharmacycenterhd.com/">canada drugs online</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>reliable canadian pharmacy</a>

      回复
    • list of approved canadian pharmacies

      <a href="http://canadianpharmacyhub.com/">online pharmacies canada</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>best mexican online pharmacies</a>

      回复
    • Eovcl90

      can cialis cause irregular heartbeat buy kamagra online uk paypal
      Atmq98m <a href=" https://withoutshort.com/ ">cialis without doctor prescription</a>
      https://withoutshort.com buy viagra 10 pills

      回复
    • pharmacy online

      <a href="http://canadianpharmacycenterhd.com/">aarp recommended canadian online pharmacies</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>pharmacy online</a>

      回复
    • list of approved canadian pharmacies

      <a href="http://canadianpharmaciespreshd.com/">canadian pharmaceuticals online safe</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>drugstore online</a>

      回复
    • best canadian online pharmacies

      <a href="http://canadianpharmacyguru.com/">online pharmacies</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>best online international pharmacies</a>

      回复
    • certified canadian online pharmacies

      <a href="http://canadianpharmaciespreshd.com/">international pharmacies that ship to the usa</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>canadian mail order pharmacies</a>

      回复
    • canadian drug stores

      <a href="http://canadianpharmacieshq.com/">list of safe online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>canadian pharmacy reviews</a>

      回复
    • mexican pharmacy online

      <a href="http://canadianpharmacyfit.com/">trust online pharmacies</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>legitimate canadian pharmacy</a>

      回复
    • canadian trust pharmacy

      <a href="http://canadianpharmacieshq.com/">certified canadian online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>top rated canadian pharmacies online</a>

      回复
    • canadian internet pharmacy

      <a href="http://canadianpharmacycenterhd.com/">canadian pharmacies that ship to us</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>online canadian pharmacy</a>

      回复
    • canada drug pharmacy

      <a href="http://canadianpharmaciesdepot.com/">canadian online pharmacy reviews</a>
      http://canadianpharmaciesdepot.com/
      <a href=http://canadianpharmaciesdepot.com/>best 10 online canadian pharmacies</a>

      回复
    • best online pharmacies

      <a href="http://canadianpharmaciesdepot.com/">canadian pharmaceuticals online reviews</a>
      http://canadianpharmaciesdepot.com/
      <a href=http://canadianpharmaciesdepot.com/>best online canadian pharmacy</a>

      回复
    • overseas pharmacies

      <a href="http://canadianpharmaciespreshd.com/">international pharmacies that ship to the usa</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>canada drug</a>

      回复
    • canada online pharmacies

      <a href="http://canadianfastpharmacy.com/">online canadian pharmacy</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>overseas pharmacies online</a>

      回复
    • safe canadian internet pharmacies

      <a href="http://canadianpharmacieshq.com/">canadian online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>best online international pharmacies</a>

      回复
    • canadian pharmacies

      <a href="http://canadianfastpharmacy.com/">reliable canadian pharmacy</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>best online pharmacy</a>

      回复
    • legitimate canadian mail order pharmacies

      <a href="http://canadianpharmacynethd.com/">list of reputable canadian pharmacies</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>legitimate canadian pharmacy</a>

      回复
    • list of safe online pharmacies

      <a href="http://canadianpharmaciesdepot.com/">canadian pharmaceuticals online</a>
      http://canadianpharmaciesdepot.com/
      <a href=http://canadianpharmaciesdepot.com/>safe online pharmacies</a>

      回复
    • reputable canadian online pharmacies

      <a href="http://canadianpharmacynethd.com/">online pharmacies</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>pharmacy online</a>

      回复
    • Namburce

      Thanks a lot. Great information. <a href=https://www.goldkamagra.com>kamagra</a> where to buy kamagra in singapore
      kamagra 100: https://www.goldkamagra.com kamagra

      回复
    • mexican online pharmacy

      <a href="http://canadianfastpharmacy.com/">pharmacy drugstore online</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>legitimate online pharmacies</a>

      回复
    • reliable canadian pharmacy

      <a href="http://canadiannextpharmacy.com/">best online international pharmacies</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>online canadian pharmacy</a>

      回复
    • canadian online pharmacy reviews

      <a href="http://canadiannextpharmacy.com/">most trusted canadian pharmacy</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>pharmacy in canada</a>

      回复
    • best canadian pharmacies

      <a href="http://canadianpharmacynethd.com/">online pharmacy reviews</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>canadian pharmacies shipping to usa</a>

      回复
    • canadian online pharmacies ratings

      <a href="http://canadianpharmacieselite.com/">mexican border pharmacies shipping to usa</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>legitimate online pharmacies</a>

      回复
    • most reliable canadian pharmacies

      <a href="http://canadiannextpharmacy.com/">canadian pharmaceuticals online</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>canadian online pharmacy no prescription</a>

      回复
    • reputable mexican pharmacies online

      <a href="http://canadianpharmacieselite.com/">best canadian online pharmacy</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>online pharmacies of canada</a>

      回复
    • legitimate canadian mail order pharmacies

      <a href="http://canadianonlinepharmacynote.com/">canadian pharmacies online</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>canada drugs online</a>

      回复
    • legitimate canadian mail order pharmacies

      <a href="http://canadianpharmacieselite.com/">canadian pharmacies shipping to usa</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>mexican online pharmacy</a>

      回复
    • canadian trust pharmacy

      <a href="http://canadianonlinepharmacynote.com/">mexican pharmacy</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>pharmacy in canada</a>

      回复
    • pharmacy drugstore online

      <a href="http://canadianonlinepharmacynote.com/">safe online pharmacies</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>certified canadian online pharmacies</a>

      回复
    • legitimate canadian pharmacy

      <a href="http://canadianpharmacyhopemeds.com/">canadian online pharmacy</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>best mexican online pharmacies</a>

      回复
    • most reliable canadian pharmacies

      <a href="http://canadianpharmacyhopemeds.com/">pharmacy drugstore online</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>legitimate online pharmacies india</a>

      回复
    • mexican pharmacy online

      <a href="http://canadianpharmacyhopemeds.com/">best mexican online pharmacies</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>canada online pharmacies</a>

      回复
    • most reliable canadian pharmacies

      <a href="http://canadianonlinepharmacykkr.com/">safe online pharmacies</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>best online canadian pharmacy</a>

      回复
    • canadian mail order pharmacies

      <a href="http://canadianonlinepharmacykkr.com/">canadian pharmaceuticals online reviews</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>canada pharmacy online</a>

      回复
    • canadian pharmacies that ship to us

      <a href="http://canadianonlinepharmacykkr.com/">canadian drugs</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>best online international pharmacies</a>

      回复
    • canada pharmaceuticals online

      <a href="http://canadianbestpharmacyonline.com/">most reliable canadian pharmacies</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>overseas online pharmacy</a>

      回复
    • international pharmacy

      <a href="http://canadianbestpharmacyonline.com/">most reliable canadian pharmacies</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>aarp recommended canadian online pharmacies</a>

      回复
    • aarp recommended canadian pharmacies

      <a href="http://canadianbestpharmacyonline.com/">pharmacy drugstore online</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>online pharmacies canada</a>

      回复
    • drugstore online

      <a href="http://canadianpharmacyhub.com/">most trusted canadian online pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>best canadian pharcharmy online</a>

      回复
    • canada drug pharmacy

      <a href="http://canadianpharmacyhub.com/">legitimate canadian mail order pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>reliable canadian pharmacy</a>

      回复
    • reputable canadian pharmacy

      <a href="http://canadianpharmacyguru.com/">mexican pharmacies online cheap</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian pharmacies shipping to usa</a>

      回复
    • reliable mexican pharmacies

      <a href="http://canadianpharmacyguru.com/">pharmacy online</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian pharmacies online</a>

      回复
    • list of approved canadian pharmacies

      <a href="http://canadianpharmacyfit.com/">mexican pharmacies online</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>canadian pharmaceuticals online safe</a>

      回复
    • canada drug

      <a href="http://canadianpharmacyfit.com/">aarp recommended canadian online pharmacies</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>aarp recommended canadian pharmacies</a>

      回复
    • EExcuppy

      chemo and hiv symptoms - <a href="https://www.withoutbro.com">cialis generic</a> Ahon21q
      meglio cialis o levitra
      will having a glass of wine after taking sildenafil: <a href="https://www.withoutbro.com/">viagra without a doctor prescription</a>

      回复
    • canadian pharmacies shipping to usa

      <a href="http://canadianpharmacycenterhd.com/">international pharmacy</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>list of reputable canadian pharmacies</a>

      回复
    • top 10 online pharmacies

      <a href="http://canadianpharmacycenterhd.com/">mexican online pharmacies</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>canadian online pharmacies ratings</a>

      回复
    • canadian pharmacies shipping to usa

      <a href="http://canadianpharmacieshq.com/">best online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>overseas pharmacies shipping to usa</a>

      回复
    • legitimate online pharmacies india

      <a href="http://canadianpharmaciespreshd.com/">aarp approved canadian online pharmacies</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>online pharmacies canada</a>

      回复
    • canadian internet pharmacy

      <a href="http://canadianpharmaciespreshd.com/">most reliable canadian pharmacies</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>reputable mexican pharmacies online</a>

      回复
    • canada drugs online review

      <a href="http://canadianpharmacieshq.com/">certified canadian online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>canadian pharmacy online</a>

      回复
    • canadian online pharmacies

      <a href="http://canadianpharmaciesdepot.com/">canadian online pharmacy reviews</a>
      http://canadianpharmaciesdepot.com/
      <a href=http://canadianpharmaciesdepot.com/>canadian pharmacies shipping to usa</a>

      回复
    • canadian online pharmacy reviews

      <a href="http://canadianpharmacieshq.com/">aarp approved canadian online pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>legitimate online pharmacies</a>

      回复
    • mexican online pharmacy

      <a href="http://canadianpharmaciesdepot.com/">highest rated canadian pharmacies</a>
      http://canadianpharmaciesdepot.com/
      <a href=http://canadianpharmaciesdepot.com/>legitimate canadian pharmacy online</a>

      回复
    • canadian pharmacies shipping to usa

      <a href="http://canadianfastpharmacy.com/">online pharmacies of canada</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>pharmacy in canada</a>

      回复
    • overseas pharmacy

      <a href="http://canadianpharmacieshq.com/">highest rated canadian pharmacies</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>reputable mexican pharmacies online</a>

      回复
    • Stephenpeaky

      roman viagra <a href=" http://sild100fast.com/# ">viagra</a> canadian pharmacy generic viagra

      回复
    • mail order prescription drugs from canada

      <a href="http://canadianpharmacynethd.com/">canada pharmacy online</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>trust pharmacy canada</a>

      回复