Score:0

NetPlan: multiple IPs with multiple gateways

gp flag

I'm trying to add additional IPs linked to different gateways to my server. I'm following the example for, "Using multiple addresses with multiple gateways" from netplan.io/Examples

Invalid YAML: mapping values are not allowed in this context: via: 112.39.226.209

My netplan config file looks like this (I've modified some numbers for security purposes): network:

version: 2
renderer: networkd
ethernets:
    ens160:
     addresses:
        - 111.225.4.42/28
        - 111.225.8.119/30
        - 112.39.226.210/28
     routes:
        - to: default
          via: 111.225.4.33
          metric: 200
        - to: default
          via: 111.225.8.113
          metric: 300
        - to: default
          via: 112.39.226.209
          metric: 400
     nameservers:
        addresses: [ "8.8.4.4", "8.8.8.8" ]

What am I doing wrong?

Score:0
gp flag

I asked a friend and it turns out I didn't need to specify the routes / alternate gateways at all so the yaml file ended up being:

version: 2
renderer: networkd
ethernets:
    ens160:
     addresses:
        - 111.225.4.42/28
        - 111.225.8.119/30
        - 112.39.226.210/28
     gateway4: 111.225.4.33
     nameservers:
        addresses: [ "8.8.4.4", "8.8.8.8" ]
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.