No documentation of solution for 'one NIC with multiple IPv4s with different gateways'

Bug #1767227 reported by Thomas Ward
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netplan
Fix Committed
Undecided
Unassigned

Bug Description

Currently, NetPlan doesn't have documentation on how to configure a single network interface with multiple IP addresses with different gateways.

In the ifupdown days, this could be achieved in /etc/network/interfaces via something like this:

auto ens3
iface ens3 inet static
        address 192.184.82.FOO
        netmask 255.255.255.0
        gateway 192.184.82.1
        dns-nameserver 8.8.8.8 8.8.4.4

auto ens3:1
iface ens3:1 inet static
 address 107.161.23.BAR
 netmask 255.255.255.0
 gateway 107.161.23.1
 dns-nameserver 8.8.8.8 8.8.4.4

Currently, NetPlan does not have this functionality documented.

There are many cases where this type of setup could be needed, such as with some VPSes, etc. which only have a single NIC that you can utilize on the system, and no ability to add additional NICs bound to the same 'connection'. Therefore, it stands to reason we might need this to be an example in documentation somewhere.

Can we get such documentation and/or examples made available?

Revision history for this message
Thomas Ward (teward) wrote :

Thanks to Cyphermox for their very useful example and description of how to achieve this.

The functionality therefore clearly exists, so maybe we can get a documentation example added?

description: updated
summary: - No solution for 'multiple IPv4s with different gateways'
+ No documentation of solution for 'one NIC with multiple IPv4s with
+ different gateways'
description: updated
Revision history for this message
Ryan Harper (raharper) wrote :

Would you want to put up a PR that updates doc/netplan.md and doc/example-config?

Revision history for this message
Ryan Harper (raharper) wrote :

Also, just for documentation within this bug, could you post what ultimately got things functioning for you?

Revision history for this message
Thomas Ward (teward) wrote :

Ryan:

Sure to the PR, after I get home.

And I will grab the working config as well when I get home, we can thank Cyphermox for the base example that got me up and running (as a template for it). I have to write up the how-to anyways for a VPS provider's KB as I am likely not alone in this problem.

Revision history for this message
Thomas Ward (teward) wrote :

Ryan:

https://github.com/CanonicalLtd/netplan/pull/24 is the PR I wrote for this, let me know if any changes are needed.

Revision history for this message
Daniel Axtens (daxtens) wrote :

This has been committed but hasn't been backported to Bionic.

Changed in netplan:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.