首页 > 解决方案 > 在 Ubuntu 20.04 上可以使用 netplan 配置多少个虚拟适配器?

问题描述

我的 Ubuntu 20 服务器机器上有一个以太网接口,名为enp65s0f1. 我想创建许多虚拟接口,每个接口都有自己的 mac 地址和 ip 地址,这些接口搭载在这个接口上,并从我的 DHCP 服务器获取它们自己的 IP 地址。我正在使用下面的 netplan 配置来完成此操作,但是从未创建第 8 个(以及之后的任何内容)虚拟设备,并且在任何日志中都没有任何关于它失败的日志(尽管我确实看到了关于它的日志设置其余的)。您可以使用 netplan 创建的虚拟设备数量是否有限制?如果是这样,真的是8吗?希望我只是做错了什么。谢谢!

# This is the network config written by 'home-lab'
network:
  version: 2
  ethernets:

    enp65s0f1v0:
      macaddress: 52:54:00:6b:3c:57
      dhcp4: true
      dhcp4-overrides:
        hostname: plex
        send-hostname: true

    enp65s0f1v1:
      macaddress: 52:54:00:6b:3c:58
      dhcp4: true
      dhcp4-overrides:
        hostname: sabnzbd
        send-hostname: true

    enp65s0f1v2:
      macaddress: 52:54:00:6b:3c:59
      dhcp4: true
      dhcp4-overrides:
        hostname: sonarr
        send-hostname: true

    enp65s0f1v3:
      macaddress: 52:54:00:6b:3c:60
      dhcp4: true
      dhcp4-overrides:
        hostname: radarr
        send-hostname: true

    enp65s0f1v4:
      macaddress: 52:54:00:6b:3c:61
      dhcp4: true
      dhcp4-overrides:
        hostname: minecraft
        send-hostname: true

    enp65s0f1v5:
      macaddress: 52:54:00:6b:3c:62
      dhcp4: true
      dhcp4-overrides:
        hostname: sevendaystodie
        send-hostname: true

    enp65s0f1v6:
      macaddress: 52:54:00:6b:3c:63
      dhcp4: true
      dhcp4-overrides:
        hostname: portainer
        send-hostname: true

    enp65s0f1v7:
      macaddress: 52:54:00:6b:3c:64
      dhcp4: true
      dhcp4-overrides:
        hostname: phpvirtualbox
        send-hostname: true

    enp65s0f1v8:
      macaddress: 52:54:00:1b:3d:00
      dhcp4: true
      dhcp4-overrides:
        hostname: eco-nds
        send-hostname: true

标签: linuxnetworkingubuntu-20.04netplan

解决方案


推荐阅读