Score:0

how to set static IP address on ubuntu server? netplan apply command ignored

za flag

I've just installed ubuntu 20.04 on an arm64 machine. To set the static IP address I searched the web and found https://linuxize.com/post/how-to-configure-static-ip-address-on-ubuntu-20-04/. But my ubuntu server doesn't have /etc/netplan directory. So I figured out I should install netplan first by doing

apt-get install netplan.io  

Then I made file /etc/netplan/01-netcfg.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
       dhcp4: no
       addresses:
         - 129.254.132.23/24
       gateway4: 129.254.132.1
       nameservers:
          addresses: [8.8.8.8, 1.1.1.1]

And this is the result when I tried to apply the setting.

root@(none):/etc# netplan apply
Running in chroot, ignoring request: daemon-reload
Running in chroot, ignoring request: is-active
Running in chroot, ignoring request: stop
Running in chroot, ignoring request.
Running in chroot, ignoring request: start

(My another ubuntu 20.04 machine has the settings in /etc/netplan/01-network-manager-all.yaml. Should I use the same file name?)

us flag
If you had a 20.04 server install and the netplan.io package was not installed, something was very wrong with your system. How did you install it? The other error messages indicate something is wrong with systemd on this system. The problems here are much deeper than "setting a static IP address", you appear to have a non-standard and unsupportable system.
za flag
@slangasek I see, thanks. I have an arm64 computer and I wanted to upgrade to ubuntu 20.04 from 18.04. I followed https://community.arm.com/developer/tools-software/oss-platforms/w/docs/457/n1sdp-getting-started-guide with changing the build-ubuntu.sh and init script for ubuntu 20.04. (I'm getting help from arm support). Maybe something is wrong during the ubuntu build and install.
us flag
The instructions on the page you link don't appear to have much to do with Ubuntu upgrades. The normal process for upgrading an Ubuntu system between releases is with the 'sudo do-release-upgrade' command from the running system. I certainly can't account for the results of a third-party upgrade procedure that leaves the system in a state that systemd believes it is running in a chroot context.
za flag
@slangasek Yes, the instruction is for fresh installing ubuntu (including ubuntu build). I have started it afresh and manged to install ubuntu 20.04 again. Then I just didn't use netplan and used editing /etc/network/interfaces and calling /etc/init.d/networking restart. (the /etc/resolv.conf contained dns servers already). Now I can use vnc for the machine. I asked arm why the ubuntu built by the guide didn't have basic packages installed. Thanks for the info.
us flag
Is there any particular reason you are not using the officially supported Ubuntu server install image? https://cdimage.ubuntu.com/ubuntu/releases/20.04/release/ BTW, /etc/network/interfaces is also not supported on recent versions of Ubuntu.
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.