Summary: Having trouble mixing public and private IPs on a PVE host. Help!
Details: I have a PVE host with a public IP and an additional /28 block (not contiguous with with host's IP). Everything works fine and all provisioned VMs have public IPs, which is appropriate for their use cases.
The problem: I want to use 10.10.x.x IPs for some containers and VMs that will run Kubernetes, likely with a simple Nginx Proxy Server in front or, if it's the only way to do it, by assigning a public IP to an Opnsense VM and using it as a gateway into the private IP space.
Working /etc/network/interfaces file -- I've never had to do anything with the /28 block of public IPs other than assign IPs to the VMs:
My problem: Everything I've tried to create a bridge into the private IP space hasn't worked. The following doesn't work, either specifying eno1 or vmbr0 in the masquerade lines:
(I know I'd need additional lines for routing specific ports; those are deleted here.)
Details: I have a PVE host with a public IP and an additional /28 block (not contiguous with with host's IP). Everything works fine and all provisioned VMs have public IPs, which is appropriate for their use cases.
The problem: I want to use 10.10.x.x IPs for some containers and VMs that will run Kubernetes, likely with a simple Nginx Proxy Server in front or, if it's the only way to do it, by assigning a public IP to an Opnsense VM and using it as a gateway into the private IP space.
Working /etc/network/interfaces file -- I've never had to do anything with the /28 block of public IPs other than assign IPs to the VMs:
Code:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet manual
# dns-nameservers 127.0.0.1
# dns-* options are implemented by the resolvconf package, if installed
iface eno2 inet manual
auto vmbr0
iface vmbr0 inet static
address PVE.HOST.PUBLIC.IP/30
gateway PVE.HOST.PUBLIC.GATEWAY
bridge-ports eno1
bridge-stp off
bridge-fd 0
My problem: Everything I've tried to create a bridge into the private IP space hasn't worked. The following doesn't work, either specifying eno1 or vmbr0 in the masquerade lines:
Code:
auto vmbr1
iface vmbr1 inet static
address 10.10.0.1/16
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.0.0/16' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.0.0/16' -o vmbr0 -j MASQUERADE
(I know I'd need additional lines for routing specific ports; those are deleted here.)
Last edited: