IP & Ports

enigmathion

New Member
Jul 25, 2015
4
0
1
Hi,

I have days looking for some information on the subject and how little I got did not result. I happen to have several (6) OpenVZ each with its ip and I have to open port 80 in each of these ip. I have understood that you have to select other settings for the port to operate in all active OpenVZ with a single ADSL connection. Could someone explain in simple terms as I do? I have configured a fixed IP pointed to my domain! thank you!
 
Last edited by a moderator:
,

I have days looking for some information on the subject and how little I got did not result. I happen to have several (6) OpenVZ each with its ip and I have to open port 80 in each of these ip. I have understood that you have to select other settings for the port to operate in all active OpenVZ with a single ADSL connection. Could someone explain in simple terms as I do? I have configured a fixed IP pointed to my domain! thank you!

Assume you have one (dynamic) IP address on the internet (ADSL or any other protocol, doesn´t matter) without NAT router, no other network and some OpenVZ containers containing WEB services lsitening on port80.


In that case set up port forwarding and NAT via iptables in Proxmox host.

Let´s assume your container IP´s have the addressee 192.168.100.10 until 192.168.100.15 and from internet you want to access to them via port 8010 to 8015:

Code:
iptables -t nat -A PREROUTING -p tcp --dport 8010 -j DNAT --to-destination 192.168.100.10:80
:
:
iptables -t nat -A PREROUTING -p tcp --dport 8015 -j DNAT --to-destination 192.168.100.15:80
iptables -t nat -A POSTROUTING -d 192.168.100.0/24 -j MASQUERADE
 
Ricardo excellent response, one more question, if I have to open multiple ports on one of them, for example, ssh port (22), ftp (21) and special (8081, 8006) then it would be something?


iptables -t nat -A PREROUTING -p tcp --dport 8010 -j DNAT --to-destination 192.168.100.10 (Undeclared port)


I was not clear who would fulfill this role:


iptables -t nat -A POSTROUTING -d 192.168.100.0/24 -j MASQUERADE


Thank you very much for your kindness!
 
As I can configure more than one port in several Open CT? The above discussion applies only to an individual port .. Thanks
 

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!