Score:0

Raspberrypi 21.10 Server static IP but boots with 2 IP (one from DHCP?)

bm flag

Set up pi with a static IP (10.0.0.180/24) following https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi Raspberrypi4 -4 with 8g

At boot it displays

eth0 IP 10.0.0.180
eth0 IP 10.0.0.55

10.0.0.55 seems to be from my router dhcp. Gateway & Nameserver are as I setup in network-config file. In the tutorial, it suggest I have to replace "dhcp4 : true" Do I have to set dhcp4 : false?

Score:0
cn flag
In the tutorial, it suggest I have to replace "dhcp4 : true" 
Do I have to set dhcp4 : false?

If you do not want a DHCP address from the router, then remove the reference to DHCP altogether. You can see an example template here:

cat /usr/share/doc/netplan/examples/static.yaml

Of course, susbstitute your exact details. Follow with:

sudo netplan generate
sudo netplan apply
Berniek avatar
bm flag
Thanks for that. Did a little more digging. There is also a "dhcp4 : true" in the netplan file that links the hardware to eth0. on boot the cloud-init rewrites the network-config file to a yaml file in the /etc/netplan directory.
Score:0
bm flag

My comment above "There is also a "dhcp4 : true" in the netplan file that links the hardware to eth0" is the problem. I guess it should not be in that file at all (ever?). It should only be part of the network-config, since the cloud-init causes netplan to write a new YAML file. Both YAML files are read and combined so netplan subsequently uses the static address & then does a DHCP as well

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.