Different networking behavior with 2nd IP on 2nd NIC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This integration test is currently failing on plucky:
https:/
This test will launch an ec2 instance, attach a 2nd NIC, and then assign two (total) IP addresses to that NIC. We then check that all 3 IP addresses can `nc` to the SSH port with the public IPs. This works consistently on Oracular and below, but it does not work on Plucky. The secondary IP on the secondary NIC can no longer connect. If I compare the generated netplan configurations between the two instances along with the generated networkd configurations, they are identical (minus different IP addresses). I can even downgrade netplan on plucky to the oracular version, but it still doesn't work on plucky. I have also manually verified that nc does work on the internal secondary IP address.
Edit: A lot of the comments here is me dumping my debug journey, but the main problem seems to be that a policy based routing rule is often missing from the rule db. Calling `netplan apply` (with no changes to the configuration) will sometimes fix it, but most of the time calling `netplan apply` leaves it without the necessary rule.
cloud-init's rendered Netplan configuration on plucky:
# cat /etc/netplan/
network:
version: 2
ethernets:
ens5:
match:
macaddress: "06:f1:2f:0b:5f:7d"
dhcp4: true
dhcp4-
dhcp6: true
dhcp6-
set-name: "ens5"
ens6:
match:
macaddress: "06:f0:7b:f6:b6:5f"
addresses:
- "192.168.15.230/20"
dhcp4: true
dhcp4-
use-routes: true
dhcp6: true
dhcp6-
use-routes: true
set-name: "ens6"
routes:
- table: 101
to: "0.0.0.0/0"
via: "192.168.0.1"
- scope: "link"
table: 101
to: "192.168.0.0/20"
- scope: "link"
table: 101
to: "2600:1f16:
routing-
- table: 101
from: "192.168.12.6"
- table: 101
from: "192.168.15.230"
- table: 101
from: "2600:1f16:
cloud-init's rendered Netplan configuration on oracular:
root@ip-
network:
version: 2
ethernets:
ens5:
match:
macaddress: "06:34:a4:59:1c:8f"
dhcp4: true
dhcp4-
dhcp6: true
dhcp6-
set-name: "ens5"
ens6:
match:
macaddress: "06:48:2a:91:51:79"
addresses:
- "192.168.2.219/20"
dhcp4: true
dhcp4-
use-routes: true
dhcp6: true
dhcp6-
use-routes: true
set-name: "ens6"
routes:
- table: 101
to: "0.0.0.0/0"
via: "192.168.0.1"
- scope: "link"
table: 101
to: "192.168.0.0/20"
- scope: "link"
table: 101
to: "2600:1f16:
routing-
- table: 101
from: "192.168.12.51"
- table: 101
from: "192.168.2.219"
- table: 101
from: "2600:1f16:
plucky networkd configurations:
root@ip-
[Match]
PermanentMACAdd
[Link]
Name=ens5
WakeOnLan=off
root@ip-
[Match]
PermanentMACAdd
Name=ens5
[Network]
DHCP=yes
LinkLocalAddres
[DHCP]
RouteMetric=100
UseMTU=true
root@ip-
[Match]
PermanentMACAdd
[Link]
Name=ens6
WakeOnLan=off
root@ip-
[Match]
PermanentMACAdd
Name=ens6
[Network]
DHCP=yes
LinkLocalAddres
Address=
[Route]
Destination=
Gateway=192.168.0.1
Table=101
[Route]
Destination=
Scope=link
Table=101
[Route]
Destination=
Scope=link
Table=101
[RoutingPolicyRule]
From=192.168.12.6
Table=101
[RoutingPolicyRule]
From=192.168.15.230
Table=101
[RoutingPolicyRule]
From=2600:
Table=101
[DHCP]
RouteMetric=200
UseMTU=true
plucky networkctl output: 192-168- 11-242: /home/ubuntu# networkctl status
192.168. 12.6 on ens6
192.168. 15.230 on ens6
2600:1f16: 67f:f200: 9786:9334: 1f2c:8d8 on ens5
2600:1f16: 67f:f200: 25ac:a1c8: 2d0d:ae87 on ens6
fe80::4f1: 2fff:fe0b: 5f7d on ens5
fe80::4f0: 7bff:fef6: b65f on ens6
192.168. 0.1 on ens6
fe80::4f8: 4ff:feed: 10b4 on ens5
fe80::4f8: 4ff:feed: 10b4 on ens6
root@ip-
● Interfaces: 1, 2, 3
State: routable
Online state: online
Address: 192.168.11.242 on ens5
Gateway: 192.168.0.1 on ens5
DNS: 192.168.0.2
Mar 10 16:05:00 ip-192-168-11-242 systemd[1]: Starting systemd- networkd- wait-online. service - Wait for Network to be Configured... networkd[ 607]: ens6: Configuring with /run/systemd/ network/ 10-netplan- ens6.network. networkd[ 607]: ens5: Link UP networkd[ 607]: ens5: Gained carrier networkd[ 607]: ens5: DHCPv4 address 192.168.11.242/20, gateway 192.168.0.1 acquired from 192.168.0.1 networkd[ 607]: ens6: DHCPv4 address 192.168.12.6/20, gateway 192.168.0.1 acquired from 192.168.0.1 networkd[ 607]: ens5: Gained IPv6LL networkd[ 607]: ens6: DHCPv6 address 2600:1f16: 67f:f200: 25ac:a1c8: 2d0d:ae87/ 128 (valid for 7min 29s, preferred for 2min 19s) networkd- wait-online. service - Wait for Network to be Configured. networkd[ 607]: ens5: DHCPv6 address 2600:1f16: 67f:f200: 9786:9334: 1f2c:8d8/ 128 (valid for 7min 29s, preferred for 2min 19s)
Mar 10 16:05:00 ip-192-168-11-242 systemd-
Mar 10 16:05:00 ip-192-168-11-242 systemd-
Mar 10 16:05:00 ip-192-168-11-242 systemd-
Mar 10 16:05:00 ip-192-168-11-242 systemd-
Mar 10 16:05:00 ip-192-168-11-242 systemd-
Mar 10 16:05:01 ip-192-168-11-242 systemd-
Mar 10 16:05:01 ip-192-168-11-242 systemd-
Mar 10 16:05:01 ip-192-168-11-242 systemd[1]: Finished systemd-
Mar 10 16:05:02 ip-192-168-11-242 systemd-
root@ip- 192-168- 11-242: /home/ubuntu# networkctl status ens6
Link File: /usr/lib/ systemd/ network/ 99-default. link
Network File: /run/systemd/ network/ 10-netplan- ens6.network
State: routable (configured)
Online state: online
Type: ether
Path: pci-0000:00:06.0
Driver: ena
Vendor: Amazon.com, Inc.
Model: Elastic Network Adapter (ENA)
Alternative Names: enp0s6
enx06f07bf6b6 5f
Hardware Address: 06:f0:7b:f6:b6:5f
MTU: 9001 (min: 128, max: 9216)
QDisc: mq
Address: 192.168.12.6 (DHCPv4 via 192.168.0.1)
192.168. 15.230
2600: 1f16:67f: f200:25ac: a1c8:2d0d: ae87
fe80: :4f0:7bff: fef6:b65f
Gateway: 192.168.0.1
fe80: :4f8:4ff: feed:10b4
DNS: 192.168.0.2...
● 3: ens6
IPv6 Address Generation Mode: eui64
Number of Queues (Tx/Rx): 2/2