I recently purchased a Kimsufi instance (a Proxmox distrib' with one public IP and one physical network interface). I want to be able to instantiate several containers/VM that will be reachable from the internet. Given some research online, I thought having a NAT configuration would be suitable for my usage. Once the setup was done, I was able to ping direct IPs but not able to resolve DNS in the containers/VM. I tried adding a DNS server different from the one of the host machine, still not working.
Here are the configurations below, is somebody familiar with this approach ? Any kind of advice/answer would be appreciated.
/etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet manual
auto vmbr0
iface vmbr0 inet static
address MY.PUB.IP.XXX/24 # anonymized on purpose
gateway MY.PUB.IP.1 # anonymized on purpose
bridge_ports eth0
bridge_stp off
bridge_fd 0
auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
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.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.10.10.2/24
gateway 10.10.10.1
dns-nameservers 8.8.8.8
/etc/resolv.conf
# --- BEGIN PVE ---
nameserver 8.8.8.8
# --- END PVE ---
Output when trying to update machine
root@container:~# apt update
Err:1 http://security.debian.org bullseye-security InRelease `
Temporary failure resolving 'security.debian.org'
Err:2 http://ftp.debian.org/debian bullseye InRelease
Temporary failure resolving 'ftp.debian.org'
Err:3 http://ftp.debian.org/debian bullseye-updates InRelease
Temporary failure resolving 'ftp.debian.org'
Reading package lists... Done
Building dependency tree... Done
All packages are up to date.
W: Failed to fetch http://ftp.debian.org/debian/dists/bullseye/InRelease Temporary failure resolving 'ftp.debian.org'
W: Failed to fetch http://ftp.debian.org/debian/dists/bullseye-updates/InRelease Temporary failure resolving 'ftp.debian.org'
W: Failed to fetch http://security.debian.org/dists/bullseye-security/InRelease Temporary failure resolving 'security.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.