Using an additional IP on Debian 13

  • I have recently bought an additional IP for my root server, but I'm struggling to get it set up correctly, I have followed the guide provided at https://www.netcup.com/en/helpcenter/documentation/server/ip, I have purchased it and added it to my server via SCP as shown:
    image.png

    I have continued to edit the nano /etc/network/interfaces file, which in Debian 13's case references another file source /etc/network/interfaces.d/* which has settings that relate to my server as below:

    Code
    auto eth0
    iface eth0 inet static
        address 152.53.160.58/22
        gateway 152.53.160.1

    As per the guide I added a new static address as follows to /etc/network/interfaces:

    Code
    iface eth0 inet static
        address 91.204.45.149
        netmask 255.255.255.0
        gateway 192.168.1.1

    After saving the file I rebooted which worked fine but if I try to replace my previous IP in my DNS settings with the new IP the server becomes unavailable, and I'm unable to connect via the new IP, if I switch the IP addresses back I am able to connect to the server.

    Should I replace the existing IP assignment in /etc/network/interfaces.d/50-cloud-init.cfg or is positioning important, should I add the new one before the existing one?

    To me having a gateway of 192.168.1.1 for an external IP address seems odd when the original one uses a similar range to the external IP.

    If it helps, I am also unable to ping the new IP address and get a response where the original will respond quite happily.

    A traceroute also provides some odd results, a tracert on Windows 11 to the original IP completes in 9 hops whereas a tracert to the new IP finds my host mail.roseitsolutions.dev [152.53.160.58] after 16 hops but continues tracing for a further 13 steps before stopping.

    Any help would be gratefully received.

  • Thanks Ecki

    With the help of Copilot I had come to a similar suggestion with my additional IP configured as follows:

    Code
    iface eth0 inet static
        address 91.204.45.149/32
        pointopoint 152.53.160.1

    Which also works now, I think something must have been off with the example command in the documentation causing the addition to be rejected, and it also wasn't showing up with ip address which I had expected, with the new config is now appears and I can also ping the address and tracert now works (via more hops), but it correctly stops once it hits 152.53.160.58 a.k.a. my original IP address which it wasn't before.

  • aderrose 12. Mai 2026 um 16:17

    Hat einen Beitrag als hilfreichste Antwort ausgewählt.
  • Does anybody know if it is possible to use the additional IP's as an outbound address? From what I understand (which may well be wrong) the additional IP's forward to the original vServer IP, so any services running on the server will see the original IP not the additional address.

  • It's not that easy to do on the same interface.

    Some applications let you choose outbound addresses, so you'll need to check the docs.

    You could try using SNAT for targets/ports/marks or setup specific routing for selected destinations.

    | VPS: 28 | vCPU: 75 | Memory: 104 GB | Disk: 4012 GB |

  • Does anybody know if it is possible to use the additional IP's as an outbound address? From what I understand (which may well be wrong) the additional IP's forward to the original vServer IP, so any services running on the server will see the original IP not the additional address.

    Use eth0:1 for the additional IP on the same interface, its just the correct way and you would not need an additional routing.
    Generally, the services, which are reachable under that IP would answer with that IP when the connection goes to that additional IP.
    If you have something like postfix, which you want to sent with the addtional IP, you have to define it on service level, in postfix’s case it is main.cf:
    smtp_bind_address = xx.xx.xx.xx

    (and keep in mind - you have also to define the correct hostname with myorigin and myhostname…)