Define a static IP for a managed VM - google-app-engine

As in the title, I'd like to deploy a managed VM attaching a static IP.
I don't want an IP for the instance lifetime, but I'd like to use the same IP every time the instance is recreated.

You'll need to switch the VM instance to "user-managed" to assign a static IP address.

Related

How to change dynamic private IP address in a virtual network to static (non-changing) IP address for containergroups (Azure Container Instances)

I currently have a containergroup that uses a virtual network to communicate. What happens is that from time to time the dynamic IP changes randomly. I know it is not possible to have a public (non-changing) IP address using a FQDN for the time being (Azure is working on it), but I was wondering if there is a way to change the IP address from dynamic to static. Any other workaround would be fine too. Thanks in advance.
Unfortunately, currently, the ACI does not provide the ability to assign a static private IP address to the container when using a private VNet. See https://feedback.azure.com/forums/602224-azure-container-instances/suggestions/36989110-allow-aci-instances-to-use-a-static-ip-address-whe.
So you could upvote that feedback so that the Azure team might improve the ACI service.

Controller IP for Juju on vSphere

I'm trying deploy Juju on our VMware lab, where we currently assign VM IPs manually. However when bootstrapping the instantiated Juju controller VM gets assigned an IPv6 IP. As there is no route for this IP, juju cannot login to the controller.
Any pointers as to what configuration juju is expecting on the vSphere side, or any way to tell it which IP the controller should use?
Thank you!
The simple solution was to setup a DCHP server to assign IPv4 addresses. VMware IP pools don't seem to be supported.

expose local webserver behind dynamic IP

I've a simple webserver bound on 0.0.0.0:3000 on my machine which works as intended on local networks. By local network I mean to say, if my mobile or any other device is on the same network, it can access local webserver by going to the IP assigned to my machine and adding port 3000 to it. Eg 192.168.1.4:3000.
Now I've to expose it to the internet but not through some sort of 3rd party application like ngrok, localtunnel or browserSync. I know that these applications work perfectly, but since I've my own pet project of controlling home appliances, I don't want to rely on availability of 3rd party services. So the current state is, I cannot control it through the internet. Keeping in mind I don't have a static IP otherwise this would've been easier.
I already have a vps and a domain name assigned to it. I can send my currently allocated ip address (since it is dynamic), by using getifaddrs, to my server and keep track of it. But how do I expose my local server to the internet through it? Those 3rd party applications assign some sort of subdomains to each exposed server, and I'll be able to assign subdomains too, but I'm still not getting any way to expose the local webserver. Any help would be appreciated, thankyou :)
Step one, you need to expose your webserver at your internet access router.
Typically this requires you to configure port forwarding for (in your case) port 3000.
With this done, any client could access your service via (current external dynamic ip):3000
Step two, you need to dynamically map a fixed DNS name to your current dynamic ip. There are of course third party services (such as DynDNS) that would help you map yourfavoritename.dyndns.org to that ever-changing ip address.
If you want to do the latter without 3rd party, you need to have some static (web) server somewhere and could proceed as follows:
Clients visit http://www.yourstaticserver.example/ and that server redirects them to (current dynamic ip):3000.
Of course, for this to happen, your static server needs to know the dynamic ip and needs no find out about changes to it.
To this end, you could have your internal server contact the static server on a regular interval (such as once a minute), say, have it access http://www.yourstaticserver.example/some-secret-special-page and the static server always stores the REMOTE_ADDR of such a request (preferably with some authorization!) for its future redirections.
Actually, there is a step zero before step one: Be aware that exposing your server to the Internet means that you expose your server to the Internet. So I hope you have invested enough thought into security.

Google cloud machine shutdown automaticaaly and and ip address change

This is regarding VM machine bitnami-wordpress-77fb and we have hosted sanver.com on this machine.
The sanver.com was not resolving, we checked and found that the machine was shutdown and ip address changed.
The previous ip address of VM machine was 130.211.77.24 and now it has changed to 104.155.55.243.
By default, an ephemeral external IP address is assigned to Google Compute Engine instances for the lifetime of the instance. Instance reboot/shutdown would cause a new ephemeral IP address to be assigned to the instance.
See more information here:
https://cloud.google.com/compute/docs/instances-and-network#ephemeraladdress

External IPs not assigned within VM

I have a couple of Centos 6 VMs that I am trying to setup. I assigned static IPs to them but when running ifconfig, I do not see the external IPs, just the internal IPs. Does Google not allow this capability?
In addition to what Anderson said, this is the command to query for the external IP from the instance itself:
curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google"
DHCP only supports requesting a single address. Google Compute Engine returns the internal IP address via DHCP, and maps the external assigned IP addresses to the VM using NAT.
If you want to fetch the assigned IP address from inside the VM, you could query the metadata server for that information.

Resources