Proxmox with a main IP Address and a container with a public ip address

Paddle

New Member
Apr 24, 2014
11
0
1
Hello,

i have 14 containers.
1 - 13 have the ip addresses 192.168.10.100 to 192.168.10.112.

Now i need an public ip address for the container which could have 192.168.10.113.

For example i have this public ip addresses.
84.26.244.123
84.26.244.234

Proxmox Host
Code:
# /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 84.26.244.123
  netmask 255.255.255.0
  gateway 84.26.244.100

#auto eth0:0
#iface eth0:0 inet static
#  address 84.26.244.234
#  netmask 255.255.255.255

My NAT / iptables rules looking like this.

Code:
iptables -A PREROUTING -d 84.26.244.123/32 -i eth0 -p udp -m udp --dport 9987 -j DNAT --to-destination 192.168.10.100:9987 # TeamSpeak3 Server Container
iptables -A PREROUTING -d 84.26.244.123/32 -i eth0 -p tcp -m tcp --dport 23 -j DNAT --to-destination 192.168.10.100:22 # SSH for TeamSpeak3 Container
iptables -A POSTROUTING -o eth0 -j SNAT --to-source 84.26.244.123


And now i want to create a container with the 84.26.244.234 ip address.
If i remove the # in the interfaces file i get a ping from the server but its the proxmox host, not the container.

How to do this?
Bridge?

Thanks in Advance!
 
Hello Paddle,

Now i need an public ip address for the container which could have 192.168.10.113.

For example i have this public ip addresses.
84.26.244.123
84.26.244.234

Add the IP address 84.26.244.234 to the container (by Network -> Add -> IP address (venet) ) in the containers configuration.

You can do it with bridge too, but should also work without - at least when you have only one address defined in venet (otherwise make a bridge)

84.26.244.234 must not appear any more in hosts configuration.

Kind regards

Mr.Holmes
 
Last edited: