Thursday, September 16, 2021

Add Additional IP to Ubuntu VPS

Step-1:

add dns of your IP Pool or you can use

 /etc/hosts

for example:
xx.zz.yy.97 ip1-pool.example.com 
xx.zz.yy.98 ip2-pool.example.com 
xx.zz.yy.99 ip3-pool.example.com 
xx.zz.yy.100 ip4-pool.example.com

Step-2:

In Ubuntu beginning with version 17.10, you can find the network configuration in the file 

/etc/netplan/01-netcfg.yaml [in Contabo VPS]
/etc/netplan/50-cloud-init.yaml [in OVH VPS]

With this method you can assign additional IPv4 and IPv6 addresses to the interface eth0. Additionally to the main IPv4 address 192.51.100.10 and the first IPv6 address of your IPv6 network, you might configure the additional IPv4 addresses 192.51.100.42 and 192.0.2.23 and the additional IPv6 addresses 2001:0db8:2a02:c200:0000:0000:0000:0002 and 2001:0db8:2a02:c200:0000:0000:0000:0003 in the area addresses: below of eth0: . It is important to keep the correct indentation!

#/etc/netplan/01-netcfg.yaml [Contabo]
network: version: 2 renderer: networkd ethernets: eth0: match: macaddress: 00:50:56:3d:c3:aa addresses: - 192.51.100.10/24 - 192.51.100.42/24 - 192.0.2.23/24 
 - 2001:0db8:2a02:c200:0000:0000:0000:0001/64 
 - 2001:0db8:2a02:c200:0000:0000:0000:0002/64 
 - 2001:0db8:2a02:c200:0000:0000:0000:0003/64 gateway6: fe80::1 routes: - to: 0.0.0.0/0 via: 192.51.100.1 on-link: true nameservers: search: [ invalid ] addresses: - 79.143.183.251 - 79.143.183.252 - 2a02:c205::1:53 - 2a02:c205::2:53

#/etc/netplan/50-cloud-init.yaml [OVH]
ens3:
            accept-ra: false
            addresses:
            - 51.222.247.31/32
            dhcp4: true
            match:
                macaddress: fa:16:3e:fa:db:ad
            mtu: 1500
            nameservers:
                addresses:
                - 213.186.33.99
                search: []
            routes:
            -   to: ::/0
                via: 2607:5300:205:200::1
            set-name: ens3


To apply the changes, please enter the command below and reboot your server:

netplan apply



No comments:

Post a Comment

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...