Skip to content

Reserve IP address for out of bounds machines #4542

Description

@aleskxyz

Ability to define IP address beside of choosing VMs in Static NAT, Port Forward and Load balancer services to provide those services to servers outside of CloudStack.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
VR
CLOUDSTACK VERSION
All versions
CONFIGURATION

Advanced networking

OS / ENVIRONMENT

N/A

SUMMARY

In some network services we need to specify which VM should use it. For example Static NAT, Port Forward and Load balancer.
It would be a good idea if we can also specify IP address of a server which is not managed by CloudStack.
This feature helps us to use network services provided by virtual router for physical servers or even VMs outside of CloudStack management area but share a common L2 network with other VMs in CloudStack.
This feature also requires reserve IP address capability in all type of networks. We can expand the issue #4357 for private IPs in isolated networks too.

STEPS TO REPRODUCE

1. Create an isolated network
2. In Port forward section define a new rule
3. In "Add VM" panel write IP address of the server outside of CloudStack

EXPECTED RESULTS

An iptables rule created in virtual router to forward desired port to the server IP

ACTUAL RESULTS

It is not possible to mention IP address of the server outside of CloudStack

Activity

  1. DaanHoogland commented on Dec 14, 2020

    @DaanHoogland
    Contributor

    sounds good, but with lots of buts. are you going to invest in tech design @aleskxyz ?

    I think I am reversing direction as opposed to what you are proposing but assigning loadbalancer configuration to an out of band (virtual) machine, would require an API served by that machine that cloudstack can use to add/remove hosts for a service.
    If indeed you mean the other way around, it sounds like a simple change given #4357 .

  2. added this to the 4.16.0.0 milestone on Dec 14, 2020
  3. aleskxyz commented on Dec 14, 2020

    @aleskxyz
    ContributorAuthor

    @DaanHoogland
    I think this diagram can help:
    image

  4. DaanHoogland commented on Dec 14, 2020

    @DaanHoogland
    Contributor

    like i described as the simple change ;)

  5. aleskxyz commented on Dec 14, 2020

    @aleskxyz
    ContributorAuthor

    like i described as the simple change ;)

    @DaanHoogland 👍
    As I told before this feature is dependent to #4357
    User must reserve the IP before using it in Static NAT, Port Forward and Load balancer. Otherwise he/she should get an error message.
    What do you mean about "tech design"?
    If you mean writing "Design Document" in https://cwiki.apache.org/confluence/display/CLOUDSTACK/ , I can help.

  6. DaanHoogland commented on Dec 15, 2020

    @DaanHoogland
    Contributor

    tnx @aleskxyz If you are not going to implement this it is sufficent to just be very precise here and find consent on it. With our discussion here it seems well scoped.

  7. modified the milestones: 4.16.0.0, 4.17.0.0 on Sep 15, 2021
  8. weizhouapache commented on Feb 16, 2022

    @weizhouapache
    Member

    @aleskxyz
    this looks different from #4357 which requested to reserve public IP.
    this means to reserve private IPs in isolated networks/vpc tiers.

    cc @nvazquez

  9. DaanHoogland commented on Feb 16, 2022

    @DaanHoogland
    Contributor

    @aleskxyz this looks different from #4357 which requested to reserve public IP. this means to reserve private IPs in isolated networks/vpc tiers.

    cc @nvazquez

    I don't think necessarily private, but as part of the range of IPs serving on the networkside, which would include the guestIPs, but also in this case an outside IP. Correct me If I'm wrong, but the Physical server having an IP inside the guest network in @aleskxyz ' picture seems irrelevant. It might as well be a google address.

  10. 34 remaining items

  11. DaanHoogland commented on Oct 17, 2025

    @DaanHoogland
    Contributor

    @aleskxyz , are you still interested in this or can we close?

  12. github-actions commented on May 6, 2026

    @github-actions

    This issue is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.

  13. Jayd603 commented on Aug 23, 2026

    @Jayd603

    I ran into this issue - I installed a physical machine on a VPC VLAN off the (physical) network switch - manually assigned an IP within the VPC - works great. However, we need to A) be able to reserve the private VPC IP of the machine so that it does not conflict with other cloudstack actions and B) allow it to be used in port forwarding/LB rules etc.

    Seems like a great feature that I'm surprised hasn't made it in yet. I am not sure it requires major re-engineering here. Just ability to add the IP as an external host and allow a feature or two (port forward,lb) to manage it within the UI/API.

  14. added
    long-term-plan
    and removed on Aug 25, 2026
  15. jmsperu commented on Nov 23, 2026

    @jmsperu
    Collaborator

    Not solved in 4.22.1.1: port forwarding, static NAT and load balancer rules all still need a CloudStack instance as target. Two things already help:

    1. Reserve part of the network: updateNetwork guestvmcidr=<smaller range> on an isolated network makes CloudStack hand out addresses only from that range; the rest is free for outside machines.
    2. Rules to an outside address: pick an address inside the CloudStack range for the outside machine and add it as a secondary IP on the NIC of any instance in that network (addIpToNic), then create the rule with vmguestip set to that address. The address counts as used, so it is never given to another instance, and the router simply forwards to it. This is lighter than the stopped dummy instance workaround.

    Checked in a lab on 4.22.1.1 (KVM, isolated network 10.45.42.0/24, then updateNetwork guestvmcidr=10.45.42.0/26):

    Check Result
    Network after the update cidr 10.45.42.0/26, networkcidr 10.45.42.0/24, reservediprange 10.45.42.63-10.45.42.254
    Three new instances all got addresses inside the /26
    Deploy asking for .200 (in the reserved part) refused: "Unable to acquire Guest IP address for network"
    addIpToNic with .200 (in the reserved part) refused: "Failed to assign secondary IP to NIC"
    addIpToNic with .50 (inside the /26) accepted
    Port forwarding rule and static NAT with vmguestip=.50 both Active, DNAT rules to .50 present on the router
    Another instance asking for .50 refused: "Unable to acquire Guest IP address for network"
    Instance that carries the secondary IP stopped the rules stay on the router

    One limit to be aware of: the two do not combine. An address in the reserved part cannot be added as a secondary IP, so an outside machine that needs port forwarding or static NAT must use an address inside the CloudStack range (held by the secondary IP), while the reserved part suits outside machines that need no rules.

    A real feature needs the maintainers to agree the data model first: Daan suggested a network detail, Wei a new table and APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity:simplecomponent:networkinglong-term-plantype:experimental-feature

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions