Ubuntu 20.04 multiple IP addresses

Discussion in 'Installation/Configuration' started by CyberspaceX, Sep 15, 2021.

  1. CyberspaceX

    CyberspaceX Member

    Hello, I have a fresh installed Ubuntu 20.04 Server but this Ubuntu Version works different than the others bevor. Can someone help me please to add multiple IP addresses permanently?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You mean adding them in the /etc/hosts?
     
  3. CyberspaceX

    CyberspaceX Member

    Ubuntu Server 20.04 uses Netplan for network configuration by default. I never work with it and I read I must edit some .yaml files. I just ask here bevor Im killing my fresh installed Server directly
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  5. CyberspaceX

    CyberspaceX Member

    Ok... let us start from beginning on...
    I use a automatic ubuntu installation from my host... so im going back and read the Ubuntu minimal server tutorial...
    First what I see:
    nano /etc/netplan/00-installer-config.yaml
    The tutorial means I need to edit this file but I only have: /etc/netplan/50-clout-init.yaml

    What is my next step to find out first what I need to do? I have no idea because some files what you talking about it here I don't find on my server...
     
    Last edited: Sep 15, 2021
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Simply create the yaml config file if it is not there.
     
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you can edit 50-cloud-init.yaml and add addresses in there. only do that if your hosting provider suggests it though.

    eg if you have a digitalocean ip4 only droplet and then add ipv6 to it, they give instructions for adding the ipv6 ip's, since it doesn't automatically add and enable the additional ip config itself, where a droplet with both ipv4 and ipv6 selected at creation does.
    if this is a vps your hosting provider gives you, you can't just go adding ip's to the netplan config yourself, you need to get the ip's from your hosting provider and only add them manually if necessary. you can't just pick your own set of wanted ip's and add them, they may not match the available subnets, or worse, they may already be in use. you could break networking not just on your vps, but on someone else's vps too.
     
  8. CyberspaceX

    CyberspaceX Member

    Ok... i create the file: /etc/netplan/00-installer-config.yaml and now? Works the system now automatically with the new file or need I change more?
     
  9. CyberspaceX

    CyberspaceX Member

    Its a dedicated server and I have full access... actually runs the server with the main ip but I have more ips that's I like to adding...
     
  10. CyberspaceX

    CyberspaceX Member

    anyway... I killing my server now... no more access and I can install everything new... better I ask for professional help...
     
  11. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    As you wish...
     
  12. CyberspaceX

    CyberspaceX Member

    I wish that's I understand my new server and can fix it alone but it looks like that's im to stupid and I hope I found a professional administrator that's can me explain my faults... because I don't have the time to install the server daily new...
     
  13. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    if you can, in any way, get back into the server, reinstate the original 50-cloud-init.ini file, and remove the 00-installer-config.yaml
    you say it's a dedicated server, and you have full access. that doesn't mean it's a physical server, and the fact that a 50-cloud-init.ini file even exists on there leads me to believe it's a virtual server.
    any additional ip's should probably be added to the original 50-cloud-init.ini file. but you need to check with the hosting/datacentre provider.
    firstly that the additional ip's can be applied to the network. just because you have a few other ip's doesn't necessarily mean that the ip routing of the line provider, or the datacentre is in place to allow those ip's on that server, they probably are, but you don't say where the ip's were assigned from, so i'm not going to just assume they'll work
    secondly, that the additional ip's would be applied directly onto the server. they could be on a firewall/router/load balancer in front of the server, they could have a system like AWS does for elastic ip's, although the ip configuration is assigned to a server/network interface. the configuration is never part of the actual server configuration itself.
     
  14. CyberspaceX

    CyberspaceX Member

    Thanks for your answer nhybgtvfr...
    I ask my provider now what kind of server I rent actually... but im waiting for a reply... I just see: Intel Xeon E3-1245 v2 - 3.4 GHz - 4 core(s) / 32GB - DDR3 / 2x 480GB (SSD SATA) and Unmetered bandwidth for a nice price... so I rent it...

    my 50-clout.init file looks like this:
    # This file is generated from information provided by the datasource. Changes
    # to it will not persist across an instance reboot. 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
    ethernets:
    enp4s0:
    dhcp4: true
    match:
    macaddress: e0:3f:49:e6:35:63
    set-name: enp4s0

    If I understand the file right I need to setup a new file first: 99-disable-network-config.cfg and than I can start editing...
    so i do: nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg and add network: {config: disabled}

    now my 50-clout.init file looks like this:
    GNU nano 4.8 50-cloud-init.yaml Modified
    # This file is generated from information provided by the datasource. Changes
    # to it will not persist across an instance reboot. 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:
    enp4s0:
    dhcp4: no
    dhcp6: no
    addresses:
    - 192.99.34.36/32
    - 192.95.52.56/30
    - 2607:5300:0060:4924:0000:0000:0000:0000/64
    gateway4: 192.99.34.254
    gateway6: 2607:5300:0060:49ff:00ff:00ff:00ff:00ff
    nameservers:
    addresses:
    - 1.1.1.1
    - 1.0.0.1
    - 8.8.8.8
    - 8.8.4.4
    match:
    macaddress: e0:3f:49:e6:35:63
    set-name: enp4s0

    Than:
    netplan generate
    netplan apply

    and reboot my server... and than no more access with ssh... or web... I can start new... the only what I can do now is to press the reinstall button... again... I don't get it...
     
    Last edited: Sep 18, 2021
  15. CyberspaceX

    CyberspaceX Member

    The server is indeed a dedicated physical server.
    The 50-cloud-init seems to be a file configuration that comes with the installation of ubuntu 20.04 in case that's i would like to deploy virtual machine on my new server.
     
  16. CyberspaceX

    CyberspaceX Member

  17. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You should ask for professional help as you intended. Some ISPConfig developers do provide that service like @florian030.
     
  18. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok, so that document shows using dhcp for the main interface and then configuring a number of secondary interfaces
    you'll still need dhcp enabled on the main interface.
    in their example:
    Code:
               set-name: INTERFACE_NAME
               addresses:
               - FAILOVER_IP/32
    
    i'm not sure if an additional ip needs it's own unique interface name, or can re-use the main interface name. ie all eth0, or eth0 main interface, eth0:0 additional ip, or if each extra ip needs it's own unique interface name or if multiple addresses can be added under one. ie: eth0 main interface, eth0:0 all additional ip's, or eth0 main interface, eth0:0 1st additional ip, eth0:1 2nd additional ip..
    i've not added additonal ip's or configured vlans on any ubuntu server since it switched to netplan.
    i'd assume each additional ip would have it's own unique interface name, but you'd best google for something like 'netplan multiple additional ip's'
    and follow the same indentation pattern you see in the original yaml files. they're bloody fussy about that, if you don't follow it correctly the whole thing breaks. :mad:

    but if you get all the ip's added, and the networking is all ok, whilst i can't 100% guarantee that ispconfig will work with it, i don't see any reason why it wouldn't.
     
  19. CyberspaceX

    CyberspaceX Member

    Hello... last night I simply try this and it works: https://gist.github.com/ThomasLeister/640812441505447ba8f19f85314fbf5b

    And today: I have a long talk with the guys from my host... my fault or problem was that's I do exactly the same that's was described in the tutorials... my host or new server needs a other configuration...

    The only strange behavior is now: I install my server new and edit the 50-cloud file with all additional IPs... Than I use the automatic installer and ISPConfig add all my IPs directly under System > Server IP Addresses

    only the main ip is double inside... I think one time from the host and one time from the yaml file...

    If I use now the DNS Wizard I have a drop down with all IPs

    But if I go to Sites and like to add a new site or edit a site it shows only a asterisk... anyway the site are available now if I setup the DNS... but im sure some configurations are still missing for ISPConfig...
     
  20. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I don't see any much difference between this and what I have shared via link earlier which also have two ip addresses which are ipv4 and ipv6. And as said in that github, you can add it in the same file or create a new one which is the idea used by ISPConfig i.e. create a yaml file, which also I have mentioned earlier. :cool:
     

Share This Page