How to install an IPv4 address on my Ubuntu

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

Introduction

You ordered and additional IPv4 address for your Raspberry PI, but you can't reach it after delivery ? We will explain how it is done

Explanation

Firstly, it's a normal behavior, Ikoula will provide you with an additional IPv4 address but you still have to configure it on your server. So to do that you will have to follow this few points :

  • Edit the network configuration file
nano /etc/netplan/01-netcfg.yaml
  • The file should look like this :
network:
 version: 2
 renderer: networkd
 ethernets:
   eth0:
     dhcp4: no
     addresses: [2a00:0c70:0130:0001:0000:0000:0000:XXXX/64]
      gateway6: 2a00:0c70:0130:0001:0000:0000:0000:0001
     nameservers:
       addresses: [2a00:c70:1:213:246:33:144:53,2a00:c70:1:213:246:36:14:53]

DO NOT USE THE TAB KEY

  • Add those lines :
addresses:
      - 178.170.X.Y/24
gateway4: 178.170.X.1
  • Now it should be like this :
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      addresses: [2a00:0c70:0130:0001:0000:0000:0000:0310/64]
      addresses:
      - 178.170.X.Y/24
      gateway4: 178.170.X.1
      gateway6: 2a00:0c70:0130:0001:0000:0000:0000:0001
      nameservers:
        addresses: [2a00:c70:1:213:246:33:144:53,2a00:c70:1:213:246:36:14:53]
  • Apply the changes with the command :
netplan try

(You might encounter an error, if so you need to go back to the file and fix it)

  • Check that the IP is UP
ip addr show
  • It should be like this :
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
   link/ether dc:a6:32:5e:b8:f3 brd ff:ff:ff:ff:ff:ff
   inet 178.170.X.Y/24 brd 178.170.X.255 scope global eth0:1
   inet6 2a00:c70:130:1::110/64 scope global
      valid_lft forever preferred_lft forever
  • Now you can use the IPv4 to reach your server.


Dedicated server | Microserver