栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

Ubuntu 18.04 配置静态IP地址

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Ubuntu 18.04 配置静态IP地址

Ubuntu 18.04 配置静态IP地址
  • 1,系统版本
  • 2,修改IP配置文件
  • 3,Ubuntu 18.04.4

1,系统版本
# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
2,修改IP配置文件
  • /etc/netplan 配置文件目录
# cat 01-network-manager-all.yaml 
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp9s0f0:
      dhcp4: no
      addresses: [192.168.0.112/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [114.114.114.114]
  • 重启网络服务
# netplan apply
3,Ubuntu 18.04.4
# cat /etc/issue
Ubuntu 18.04.4 LTS n l
  • 默认配置
# cat /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 reboot.  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:
        eno2:
            dhcp4: true
    version: 2
  • 应用配置
netplan apply
network:
    ethernets:
        eno1:
            dhcp4: true
        eno2:
            dhcp4: no
            addresses: [192.168.0.11/24]
            gateway4: 192.168.0.1
            nameservers:
                addresses: [114.114.114.114]
    version: 2
systemctl status  systemd-networkd
netplan --debug apply
network:
    renderer: networkd
    ethernets:
        eno1:
                dhcp4: no
                addresses: [192.168.0.100/24]
                gateway4: 192.168.0.1
                nameservers:
                    addresses: [114.114.114.114]
        eno2:
                dhcp4: no
                addresses: [192.168.0.101/24]
                gateway4: 192.168.0.1
                nameservers:
                    addresses: [114.114.114.114]

    version: 2

参考:

  1. ubuntu18.04LTS设置静态IP
  2. Ubuntu 18.04 LTS 使用 Netplan 配置网络教程
  3. How to configure static IP address on Ubuntu 18.04 Bionic Beaver Linux
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/268748.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号