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

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.

Related

List Mule Apps and their IP addresses

Is there a way to list all the Mule applications deployed in a VPC in Cloudhub, and their private IP addresses as a report (maybe in Monitoring)? I know the private IP addresses are dynamic and will change, but is there a way to get such a report?
There is no built-in way to do that however you can gather the information together with a script or application. I can give you the high level direction. You need to get the list of applications for each environment associated with the VPC, get the deployment region to confirm that it matches the VPC region (just in case that multi region deployments are enabled) and the status to ensure it is running. You can use CloudHub 1.0 REST API: https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-api/minor/1.0/pages/home/
Then with the resulting list of applications you can query the DNS names used by CloudHub 1.0:
mule-worker-myapp.region.cloudhub.io to get the public IPs
mule-worker-internal-myapp.region.cloudhub.io to get the internal IP inside the VPC

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.

Define a static IP for a managed VM

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.

How to connect to a client in Broadband shared IP

I am using a Broadband Router on which multiple pcs use the same shared ip as the public ip. how can some other remote client get a specific IP address to connect to me?
I was developing a Client/Server Chat Program using C.
Thanks for considering.
They cannot. The broadband router is the only one with a public IP address.
The usual solution to this problem is to have the router forward a specific port to one of your NAT'd internal machines.
If that's not sufficient, you could investigate "hole punching" and STUN.

get ip address (when no ASP.NET available (on linux server))

I can't find the ip address without the aspx page (so on a linux server). If it can work through wcf then its also good.
I think your best bet is to let a web service return the IP address to the Silverlight client if you are able to use WCF in your application. I don't believe there is any straightforward way to get the client IP directly within Silverlight.
Just a simple web method like this should work:
[OperationContract]
public string GetClientIpAddress()
{
return HttpContext.Current.Request.UserHostAddress;
}
You might not be able to get the actual client IP address if the request is going through a proxy server, but you could check the HTTP_X_FORWARDED_FOR header as well and use that if available.
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
I wouldn't depend on that as a reliable client IP address though, since not all proxy servers honor that HTTP header and it could also be easily spoofed.

Resources