How to add or configure extra IP Ubuntu 20.04?
To add or configure extra IP ubuntu 20.04, kindly follow the below instructions:
Step 1: Find Netplan Configuration File, Look for Netplan's configuration file using:
SSH: ls /etc/netplan/
Step 2: Open this file with a text editor, for example, note: here: 50-cloud-init.yaml it can be something else this file name you will get from step 1:
SSH: sudo nano /etc/netplan/50-cloud-init.yaml
Step 3: Suppose your Netplan configuration file looks similar to this:
network:
version: 2
ethernets:
ens3:
accept-ra: false
addresses:
- 2001:41d0:401:3000::2adf/56
dhcp4: true
match:
macaddress: fa:16:3e:7c:d6:26
mtu: 1500
nameservers:
addresses:
- 213.186.33.99
search: []
routes:
- to: ::/0
via: 2001:41d0:401:3000::1
set-name: ens3
Step 4: Now add your extra IP like below, after adding IP press ctrl+x & save plus exit it:
network:
version: 2
ethernets:
ens3:
accept-ra: false
addresses:
- 2001:41d0:401:3000::2adf/56
- 149.202.53.205/32 #New Extra IP
dhcp4: true
match:
macaddress: fa:16:3e:7c:d6:26
mtu: 1500
nameservers:
addresses:
- 213.186.33.99
search: []
routes:
- to: ::/0
via: 2001:41d0:401:3000::1
set-name: ens3
Step 5: Apply Changes, After saving the file:
SSH: sudo netplan apply
Step 6: Verify New Configuration, Check that the new IP address has been applied:
SSH: ip a
You are done, your extra IP will ping now.