2

I need to add new IP addresses to my server which runs Ubuntu 18.04.1 LTS, then I realised that Ubuntu 18.04 changed network configuration to use netplan.

I read that all configurations are under /etc/netplan directory but in my system there is no file under that directory.

Where are my network configuration files, and how do I add new IP addresses there?

  • 1
    Are you using a GUI (NetworkManager) or is this a server install? (In which case there should be a network configuration under the netplan folder) Or is this server upgraded from an older Ubuntu? – Thomas Ward Nov 6 at 16:43
  • 1
    @ThomasWard it's server install. It's installation not upgraded from an older version. – eerrzz Nov 6 at 16:48
  • Can you do me a favor and see if there's networking defined in /etc/network/interfaces still on your system? And is this a VPS with a prebuilt install image possibly? – Thomas Ward Nov 6 at 17:27
  • @ThomasWard no it's not exist. – eerrzz Nov 6 at 18:01
  • @ThomasWard it's dedicated from ovh servers. – eerrzz Nov 6 at 18:02
0

I researched more and found these;

My default network configuration is here: /etc/systemd/network/50-default.network

Main IP address, gateway and other things are resides in that file. This explains strangeness that even /etc/network/interfaces not exist and /etc/netplan directory is empty, system is still running without problem.

This page helped me to add new IP addresses:

https://docs.ovh.com/gb/en/vps/network-ipaliasing-vps/#step-1-create-the-configuration-file

I created 50-cloud-init.yaml file and fill it with these informations,

network:
    version: 2
    ethernets:
        enp96s0f0:
            dhcp4: true
            match:
                macaddress: xx:xx:xx:xx:xx:xx
            set-name: enp96s0f0
            addresses:
            - 51.189.170.192/32
            - 51.189.170.193/32
            - 51.189.170.194/32
            - 51.189.170.195/32
            - 51.189.170.196/32
            - 51.189.170.197/32
            - 51.189.170.198/32
            - 51.189.170.199/32
            - 51.189.170.200/32
            - 51.189.170.201/32
            - 51.189.170.202/32
            - 51.189.170.203/32
            - 51.189.170.204/32
            - 51.189.170.205/32
            - 51.189.170.206/32
            - 51.189.170.207/32

Then run netplan apply and it's working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.