NAT, Bridged and Host-only setups for CTs?

LaxSlash1993

New Member
Nov 1, 2015
3
0
1
Hi everyone,

I'm new to the administration end for the whole world of VMs. I downloaded Proxmox with the intentions of setting up a localized development cluster within a VirtualBox VM.

Regrettably, I can't install a KVM VM within that as it would seem. So it looks like I'm stuck to using LXC Containers. Now I have the LXC IPs talking to the Host Machine and vice versa via a ping command - 192.168.56.1 (being the host machine), 192.168.56.2 (being the PVE install) and 192.168.56.3-5 being the current CTs, using Host-only networking on adaptor 2.

On adaptor 1, I'm using Bridged Networking, with the PVE installation talking on 192.168.1.15 within my home's LAN as well as talking to the outside world using that.


What I'm trying to accomplish is this, but I have no idea how to set it up. I want the VM and CTs to talk to my host machine directly via the Host-only adapter addresses 192.168.56.x. This is going to be the main IP Address for any and all services on the containers, such as Apache, MySQL, Mail, SSHD, etc. But I also need it to talk to the outside world, which I would like it to do via a new IP that I want to assign to my host VM (192.168.1.16), which I'm planning on doing through a 3rd VirtualBox adaptor. I don't want the CTs to be able get their own home LAN IPs, I want them to talk to the internet using a shared IPv4 - kinda like a NAT. No services will go through that except for dowloading packages via yum, getting updates, etc.

And then once this gets working, I'd lke to look at adding multiple host-only IPs to the guests.

Is this possible to accomplish? If so, could someone help me out here? Thanks!
 

Mr.Holmes

Member
Apr 5, 2014
281
2
16
Hello LaxSlash1993,
I'm new to the administration end for the whole world of VMs. I downloaded Proxmox with the intentions of setting up a localized development cluster within a VirtualBox VM.

Regrettably, I can't install a KVM VM within that as it would seem.
You can probably install, but not run it because Virtual Box does not allow nested HW virtualization. Don't know which native OS you have - but why not consider LINUX Proxmox distro? It is a full DEBIAN, you can install desktop environment as Gnode, KDE, LXDE etc. on in; then nested virtualization is possible und you can use your test-Proxmoxs as VMs in it.

So it looks like I'm stuck to using LXC Containers. Now I have the LXC IPs talking to the Host Machine and vice versa via a ping command - 192.168.56.1 (being the host machine), 192.168.56.2 (being the PVE install) and 192.168.56.3-5 being the current CTs, using Host-only networking on adaptor 2.

On adaptor 1, I'm using Bridged Networking, with the PVE installation talking on 192.168.1.15 within my home's LAN as well as talking to the outside world using that.


What I'm trying to accomplish is this, but I have no idea how to set it up. I want the VM and CTs to talk to my host machine directly via the Host-only adapter addresses 192.168.56.x. This is going to be the main IP Address for any and all services on the containers, such as Apache, MySQL, Mail, SSHD, etc. But I also need it to talk to the outside world, which I would like it to do via a new IP that I want to assign to my host VM (192.168.1.16), which I'm planning on doing through a 3rd VirtualBox adaptor. I don't want the CTs to be able get their own home LAN IPs, I want them to talk to the internet using a shared IPv4 - kinda like a NAT. No services will go through that except for dowloading packages via yum, getting updates, etc.


And then once this gets working, I'd lke to look at adding multiple host-only IPs to the guests.

Is this possible to accomplish?
Not quite sure what you want, I guess accessing from containers to internet without having an address in your router LAN 192.168.1.0/24 ?!

In that case define in your Proxmox VM a NAT as follows (assuming 192.168.1.16 is assigned to eth0, adapt it accordingly):

Code:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
In your containers define 192.168.56.2 as default gateway; then you have NAT behind NAT - no problem, in works fine.


Kind regards
Mr.Holmes
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!