IPv4 default gateway disappears after setting IPv6 address and gateway
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debian-installer (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When doing a clean install (in this case of Ubuntu 24.04, but also with 22.04 and possibly even 20.04, but that has been a while…) I consistently run into the following situation:
1) I manually configure IPv4
I open a console and check the network settings. `ip addr` shows the address and `ip route` shows the subnet route and default gateway.
2) I manually configure IPv6
I go back to the console and check the network settings again. `ip addr` shows both IPv4 and IPv6, `ip -6 route` shows the IPv6 default gateway, but `ip route` now only shows the subnet route. The default gateway is gone.
This causes delays when the testing of the repository is done (nl.archive.
This problem persists after boot, as the default IPv4 gateway isn't written to the netplan config:
```
sander@cloud:~$ sudo -i
[sudo] password for sander:
root@cloud:~# cd /etc/netplan/
root@cloud:
50-cloud-init.yaml
root@cloud:
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
ethernets:
ens160:
- 185.54.92.4/26
- 2a00:8642:
- 8.8.8.8
- 2001:4860:
routes:
- to: default
version: 2
root@cloud:
```
Manually adding the correct gateway fixes everything:
```
root@cloud:
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
ethernets:
ens160:
- 185.54.92.4/26
- 2a00:8642:
- 8.8.8.8
- 2001:4860:
routes:
- to: default
- to: default
version: 2
root@cloud:
root@cloud:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=6.21 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=3.81 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 3.805/5.
root@cloud:
```
Fixes the issue, and the system runs fine after that.