Score:0

How to set ip address correctly?

br flag

I apologize in advance if my english is bad

i want to ask how to set the ip address, i have written this command, and then saved ctrl + x > Y > enter

https://i.stack.imgur.com/uUEkH.png

but the result doesn't match

https://i.stack.imgur.com/z3tuN.jpg

I've been working on it for 4 days but it keeps failing, I hope there's an angel here who can help me

user535733 avatar
cn flag
Your YAML seems incorrect. It is missing a `renderer:` line. See https://netplan.io/examples/#using-dhcp-and-static-addressing for working examples.
heynnema avatar
ru flag
What version Ubuntu? Desktop or Server installation? [Edit your question](https://askubuntu.com/posts/1345281/edit), using copy/paste, not screenshots, and show me `cat /etc/network/interfaces` and `ls -al /etc/netplan` and `cat /etc/netplan/*.yaml` and `sudo lshw -C network`. Start comments to me with @heynnema or I'll miss them.
Score:0
us flag

The highlighted output also shows that the wrong address is dynamically assigned.

This means something else, besides the netplan yaml file you have shown, is configuring addresses on this interface, probably via dhcp.

If you have the dhcpcd5 package installed on your system, you should remove it.

However, I also note that in your editor screenshot, it shows a filename of 00-installer-config.yml. Netplan does not support reading configuration from files with a .yml extension. The correct extension is .yaml. It is possible that the dhcp address is a result of unmodified configuration in /etc/netplan/00-installer-config.yaml, which will do dhcp by default, and the file you are editing is ignored by netplan.

Score:0
in flag

I had a similar problem days ago. The mistakes were:

  1. Not realizing the YAML file was not even read by netplan
  2. YAML spelling & not applying the changes properly.
  3. Link/ interface down

3 is not a problem here. Let's see the rest.

Netplan only reads the yaml extension, not the yml extension So rename the file:

cd < access 00-... directory >
mv 00-installer-config.yml 00-installer-config.yaml

To see if the spelling is correct & makes sense for the parser run sudo netplan --debug generate. This tells any spelling or configuration error.

[It is missing a renderer, but that may or may not be important because it will use networkd as default (sorry for this technical bit).]

Next you need to run sudo netplan apply.


So:

  1. Rename the file
  2. Add a renderer (either networkd or network-manager)
  3. Run sudo netplan --debug generate And if this is ok
  4. sudo netplan apply

If you run netplan help all options described will show up for you.

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.