欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu 18.04 单网卡多IP设置

程序员文章站 2022-06-03 21:25:38
...

16.04的/etc/network/interfaces已经没用了,用新工具netplan

Multiple addresses on an interface

The addresses key can take a list of addresses to assign to an interface:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
     addresses:
       - 10.100.1.38/24
       - 10.100.1.39/24
     gateway4: 10.100.1.1

让他生效:netplan apply