小编Tor*_*ger的帖子

How to add a static secondary IP to a DHCP interface using netplan?

我的服务器有一个文件 /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:
    version: 2
    ethernets:
        ens3:
            dhcp4: true
            match:
                macaddress: fa:**:**:**:**:**
            set-name: ens3
Run Code Online (Sandbox Code Playgroud)

这导致以下接口配置:

2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:**:**:**:**:** brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.5/24 brd 10.0.0.255 scope global dynamic …
Run Code Online (Sandbox Code Playgroud)

dhcp static-ip linux-networking netplan

6
推荐指数
2
解决办法
9419
查看次数

标签 统计

dhcp ×1

linux-networking ×1

netplan ×1

static-ip ×1