How to give container my public ip address

rabbani

New Member
Aug 31, 2023
7
0
1
i want to use one of my container as load balancer and give it my public ip instead of 192.168...
how can i do it easily??? this is my pve settings
Capture.PNG
 
Last edited:
Hi,
first off, do you know if you actually have a real public address that terminates at your router? Most residential connections don't have a real IPv4 address anymore and you could be behind a carrier grade nat. This would mean that there is not really a chance to be reachable via IPv4. Some providers can switch you to a real address, if you ask them nicely, but I don't know if thats common, or just something that is usual for my corner of the world.

If you have a real address, you would need to configure port forwarding in your router, for the services you want to use. This varies from device to device, so I can't give you a definitive guide.
For example, if you want to host a webserver, you would forward port 80 and 443 to the container that is hosting the 'load balancer' and from there reverse proxy to the different services that you are hosting.
 
  • Like
Reactions: rabbani
Hi,
first off, do you know if you actually have a real public address that terminates at your router? Most residential connections don't have a real IPv4 address anymore and you could be behind a carrier grade nat. This would mean that there is not really a chance to be reachable via IPv4. Some providers can switch you to a real address, if you ask them nicely, but I don't know if thats common, or just something that is usual for my corner of the world.

If you have a real address, you would need to configure port forwarding in your router, for the services you want to use. This varies from device to device, so I can't give you a definitive guide.
For example, if you want to host a webserver, you would forward port 80 and 443 to the container that is hosting the 'load balancer' and from there reverse proxy to the different services that you are hosting.
Thank you for your reply, you are right, my router wan ip is different than my dynamic public ip. is it possible to configure container for web serving in this setup......if i get a static public ip and set load balancer container with the public ip and web server containers with lan ips. is there any configuration i need to do inside network configuration...
 
Last edited:
Your provider would probably not give you an additional static IP, but replace your current IP with a static one. This means that you can't fully pass through all traffic on that IP to the container, or you have no internet in the rest of the network anymore.
This is why you would use something like port forwarding on your router to only send incoming traffic on port 80 and 443 to your container and route the rest of the traffic as usual. On the container side you probably need no special configuration, it just gets the forwarded traffic from your router. You must not set the containers IP to your public one, since that one is in use by your router. The router takes in traffic on the public IP, translates and forwards it to your server, that is listening on the local ip.
 
  • Like
Reactions: rabbani
Your provider would probably not give you an additional static IP, but replace your current IP with a static one. This means that you can't fully pass through all traffic on that IP to the container, or you have no internet in the rest of the network anymore.
This is why you would use something like port forwarding on your router to only send incoming traffic on port 80 and 443 to your container and route the rest of the traffic as usual. On the container side you probably need no special configuration, it just gets the forwarded traffic from your router. You must not set the containers IP to your public one, since that one is in use by your router. The router takes in traffic on the public IP, translates and forwards it to your server, that is listening on the local ip.
Thank you!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!