How to configure two segment's IP addresses' gateway use netplan ?
#!/bin/bash
network:
version: 2
renderer: networkd
ethernets:
enp1s0f1:
addresses:
- 22.95.140.1/24
...
- 22.95.141.1/24
- 22.95.141.2/24
....
gateway4: 22.95.140.254
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
dhcp4: no
optional: no
You see I configured two IP segment 22.95.140.0/24
and 22.95.141.0/24
.
but there I only configured one gateway, gateway4: 22.95.140.254
, is there I need two IP segments' gateway?
if I need two, how can I configured it?
should I configured like this?
gateway4: [22.95.140.254, 22.95.140.254]