Need to implement public IP's to LXC's

Judging by the large subnet your static IP is in, I'm assuming your 5 IPs are all contiguous and in the same subnet. Is that true? Or are the 4 other addresses in a separate subnet?

In the case where they are all in the same subnet then the routing option, at least as it's outlined in the wiki, isn't going to work for you. You would simply need to create a bridge on the host interface and configure the container to use that. Then configure the container with one of the IPs you were given.
 
Thank you both for your replies. Yes I did forget to describe the IP ranges. Unfortunately 1 is of a different subnet (different gateway) and the other 4 are on the same gateway. I have still have not produced a solution for this yet, very frustrating! I can see why you have to pay $$$ for support, lol!
 
@sienar,

Let me try to explain in a little more detail, as I realize that my original statement was quite vague (sorry guys!)

I have the following 5 IP's:

A1 = IP-1 from subnet-1
N1 = netmask from subnet-1
G1 = gateway from subnet-1

B1 = IP-1 from subnet-2
B2 = IP-2 from subnet-2
B3 = IP-3 from subnet-2
B4 = IP-4 from subnet-2
N2 = netmask from subnet-2
G2 = gateway from subnet-2


A1,N1,G1 were the original from my hosting provider and came with the dedicated server.
B1-> B4 were the added IP's that came later . . .

So far, I have added all the IP's in the /etc/hosts file along with the hostnames that I will be using with those containers or VM's when they are created.

So, I guess my question is? How would I implement all 4 IP's to be used in either a container or VM? The best answer I would find for myself and maybe others, would be a sample using the "etc/network/interfaces" file format here in this post using the abbreviated syntax that I listed above for IP, netmask, and gateway to make them available for Proxmox . . .

Thanks in advance!
 
Last edited:
@sienar,

Let me try to explain in a little more detail, as I realize that my original statement was quite vague (sorry guys!)

I have the following 5 IP's:

A1 = IP-1 from subnet-1
N1 = netmask from subnet-1
G1 = gateway from subnet-1

B1 = IP-1 from subnet-2
B2 = IP-2 from subnet-2
B3 = IP-3 from subnet-2
B4 = IP-4 from subnet-2
N2 = netmask from subnet-2
G2 = gateway from subnet-2


A1,N1,G1 were the original from my hosting provider and came with the dedicated server.
B1-> B4 were the added IP's that came later . . .

So far, I have added all the IP's in the /etc/hosts file along with the hostnames that I will be using with those containers or VM's when they are created.

So, I guess my question is? How would I implement all 4 IP's to be used in either a container or VM? The best answer I would find for myself and maybe others, would be a sample using the "etc/network/interfaces" file format here in this post using the abbreviated syntax that I listed above for IP, netmask, and gateway to make them available for Proxmox . . .


Basically each container's virtual NIC works identically to a real physical NIC which is connected to the network via a switch - in case of a container the switch's role is taken over by a network bridge (vmbr0, vmbr1 etc.).


BUT: In order to avoid misuse hosters usually block traffic to unknown MAC addresses - and the container's virtual NICs have unknown MAC addresses. On the other hand some hosters offer methods to allow traffic despite these restrictions. How it works in particular is hoster-specific and cannot be said in general. Contact you hoster or give the method described above a try since some hosters don't block traffic from/to unknown MAC addresses.
 
  • Like
Reactions: TGW

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!