Help changing static ip

I’m trying to change the static IP. I’ve gone to /etc/netplan/ directory and there is no ‘.yaml’ file. is there supposed to be one here?

It looks like the networkd service is running so I create a yaml file in /etc/netplan called 01-netcfg.yaml with the following contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}

network:
        version: 2
        renderer: networkd
        ethernets:
                eth0:
                        address:
                                - 192,168.1.31/24
                                  #gateway4: 192.168.1.1
                        nameservers:
                                addresses: [8.8.8.8, 8.8.4.4]

This approach is taken from

https://netplan.io/examples

When I run sudo netplan apply I get the following error

Error in network definition //etc/netplan/01-netcfg.yaml line 12 column 24: unknown key address

What am I missing here?

I did find this

https://pynq.readthedocs.io/en/v2.0/faqs.html#how-do-i-set-change-the-static-ip-address-on-the-board

Why do we edit this instead of using the regular netplan yaml config?

Are you just trying to change it after the board has booted?

From terminal:
sudo ifconfig eth0:0 [new IP address]

Cathal

I was trying to change it permanently so it is set to a different address (different than .99) once booted and for all other boots.

If you go to /etc/network/interface.d and open the eth0 file. You can change the boards default IP address for every boot.

Also, if you aren’t planning on connecting this board to a router or anything you could comment out the top two lines while you are editing the file.

2 Likes

Thank you sleach3! I’m curious - I thought Ubuntu18x used netplan. It looks like bionic is Ubuntu 18.x why isn’t this using netplan like Ubuntu 18?

That I can not help you with. I assume that they use some modified system to make it run more efficiently.

1 Like

Using /etc/network/interface.d is quite a standard technique…

You can probably try netplan, but you have to apt install it before using it.

1 Like