Score:0

Ubuntu Server 22.04 has two IP addresses

rw flag

My Ubuntu Server has over LAN (eth0) two IPv4 addresses from one day to another. Maybe this happened with an update. I use it as a web server for WordPress and local DNS with Pi-Hole. All services are working normally. System information at login:

 Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1024-raspi aarch64)
 
  * Documentation:  https://help.ubuntu.com  * Management:    
 https://landscape.canonical.com  * Support:       
 https://ubuntu.com/advantage
 
   System information as of Wed Feb 22 17:28:28 CET 2023
 
   System load:  0.1796875           Processes:             168   Usage
 of /:   12.0% of 234.32GB   Users logged in:       0   Memory usage:
 27%                 IPv4 address for eth0: 169.254.99.100   Swap
 usage:   0%                  IPv4 address for eth0: 192.168.7.100  
 Temperature:  34.1 C
 
  * Strictly confined Kubernetes makes edge and IoT secure. Learn how
 MicroK8s    just raised the bar for easy, resilient and secure K8s
 cluster deployment.
 
    https://ubuntu.com/engage/secure-kubernetes-at-the-edge
 
  * Introducing Expanded Security Maintenance for Applications.   
 Receive updates to over 25,000 software packages with your    Ubuntu
 Pro subscription. Free for personal use.
 
      https://ubuntu.com/pro
 
 Expanded Security Maintenance for Applications is not enabled.
 
 0 updates can be applied immediately.
 
 3 additional security updates can be applied with ESM Apps. Learn more
 about enabling ESM Apps service at https://ubuntu.com/esm

Static IP 192.168.7.100 is set at /etc/netplan/50-cloud-init.yaml There is no other *yaml file in this folder.

Netplan settings:

network:
    ethernets:
        eth0:
            link-local: [ ipv4 ]
            addresses:
            - 192.168.7.100/24
            dhcp4: false
            nameservers:
                addresses:
                - 192.168.7.1
                - 8.8.8.8
            routes:
              - to: default
                via: 192.168.7.1
    version: 2

Why does my server have a second IPv4 169.254.99.100 and is it possible to remove this second IP?

Results of ip route and ip a :

alexadmin@ubuntuserver:/etc/netplan$ ip route
default via 192.168.7.1 dev eth0 proto static 
169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.99.100 metric 2048 
192.168.7.0/24 dev eth0 proto kernel scope link src 192.168.7.100 
alexadmin@ubuntuserver:/etc/netplan$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:a5:6f:be brd ff:ff:ff:ff:ff:ff
    inet 169.254.99.100/16 metric 2048 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet 192.168.7.100/24 brd 192.168.7.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:a5:6f:bf brd ff:ff:ff:ff:ff:ff

After removing link-local: [ ipv4 ] in netplan, result of ip a:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:a5:6f:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.100/24 brd 192.168.7.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fd35:2cf:f17a:4a41:dea6:32ff:fea5:6fbe/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 1741sec preferred_lft 1741sec
    inet6 fe80::dea6:32ff:fea5:6fbe/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:a5:6f:bf brd ff:ff:ff:ff:ff:ff
Pilot6 avatar
cn flag
Please don't post screenshots of text.
Alex avatar
rw flag
@Pilot6: Ok, sorry I have replaced the sceenshots.
Pilot6 avatar
cn flag
@user535733 It is a private address.
Alex avatar
rw flag
@user535733: No this is not my external IP. According to my FritzBox Router I have 93.* as my external IP address. Router is setup for DHCP with 192.168.7.* All clients in my network has this address and there is no 169.* IP shown in Network section at Fritzbox. I have checked my notebook is has only IP 192.168.7.92. Strange is, I can ping 169.254.99.100 from my notebook. Tested it also on a windows machine. I could also ping 169.* IP.
chili555 avatar
cn flag
169.254.x.y is a link-local address which you declared in netplan. Try removing: `link-local: [ ipv4 ]` follow with: `sudo netplan generate` and `sudo netplan apply` Check again: `ip a` Is the problem resolved?
Alex avatar
rw flag
@chili555 I did as you wrote. The IPv4 link-local address is gone but now I have a IPv6. Is this now the link-local address as IPv6? On my router I have disable IPv6 for my network. I have add above what `ip a` shows now.
chili555 avatar
cn flag
Evidently, you did not properly disable IPv6 in the router because you have what appears to be a vaild address. Test: `ping6 -c3 www.google.com` If you get returns, you are getting a vaiid IPv6 address. I don't understand why you'd want to disable it at all. Since your original question is solved, I'll write an answer that I hope you'll accept.
Alex avatar
rw flag
@chili555 Thank you very much for your input. As you wrote the 169.* IPv4 address is gone after editing netplan. I will check my network about IPv6 and if needed I will create new question.
Score:1
cn flag

In your netplan file, you included:

link-local: [ ipv4 ]

The result was that you received the usual link local IPv4 address 169.254.x.y. I suggested that you remove that line. You no longer have an IPv4 link local address:

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:a5:6f:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.100/24 brd 192.168.7.255 scope global eth0
       valid_lft forever preferred_lft forever
etc.

If you have futher questions about your IPv6 address, please start a new question.

I sit in a Tesla and translated this thread with Ai:

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.