Ubuntu24.04单网卡配置多IP
原始配置:
root@Hanmber-Movble:/etc/netplan# cat 90-NM-f844b322-4a67-3574-bc41-771c12a6ba7f.yaml
network:
version: 2
ethernets:
NM-f844b322-4a67-3574-bc41-771c12a6ba7f:
renderer: NetworkManager
match:
name: "enp2s0"
addresses:
- "192.168.1.231/24"
nameservers:
addresses:
- 192.168.1.1
dhcp6: true
ipv6-address-generation: "stable-privacy"
wakeonlan: true
networkmanager:
uuid: "f844b322-4a67-3574-bc41-771c12a6ba7f"
name: "有线连接 1"
passthrough:
connection.autoconnect-priority: "-999"
connection.timestamp: "1737422035"
ethernet._: ""
ipv4.address1: "192.168.1.231/24,192.168.1.1"
ipv4.method: "manual"
ipv6.ip6-privacy: "-1"
proxy._: ""
修改配置:
直接在添加IP的地方添加即可。
network:
version: 2
ethernets:
NM-f844b322-4a67-3574-bc41-771c12a6ba7f:
renderer: NetworkManager
match:
name: "enp2s0"
addresses:
- "192.168.1.231/24"
- "99.0.0.122/24"
- "192.168.100.122/24"
nameservers:
addresses:
- 192.168.1.1
dhcp6: true
ipv6-address-generation: "stable-privacy"
wakeonlan: true
networkmanager:
uuid: "f844b322-4a67-3574-bc41-771c12a6ba7f"
name: "有线连接 1"
passthrough:
connection.autoconnect-priority: "-999"
connection.timestamp: "1737422035"
ethernet._: ""
ipv4.address1: "192.168.1.231/24,192.168.1.1"
ipv4.method: "manual"
ipv6.ip6-privacy: "-1"
proxy._: ""
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。