VMs have no Internet after fresh install using NAT

Lucas1232

New Member
Jun 16, 2024
10
1
3
Hello everyone,
I have been working with basic linux for a few years and have now decided to expand my knowledge.

My setup:
I have a Strato VPS Linux VC8-32 with a public IP running Debian 12

My plan:
I would like to install proxmox so that I can run different services independently (Plesk, possibly a game server manager like Pelican or Pterodactyl). I assume that I have to work with NAT - IpTables, because I only have one public IP address.

My progress:
I got Proxmox up and running. Then copied the network config of Proxmox with NAT from https://pve.proxmox.com/wiki/Network_Configuration

Code:
/etc/network/interfaces:

auto lo
iface lo inet loopback

iface ens6 inet manual

auto eno1
#real IP address
iface eno1 inet static
address 85.***.***.**/24
gateway 85.***.***.1

auto vmbr0
#private sub network
iface vmbr0 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 eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE

post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

Code:
root@proxmox:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02******** brd ff:ff:ff:ff:ff:ff
    altname enp0s6
    inet 85.***.***.**/32 metric 100 scope global dynamic ens6
       valid_lft 388sec preferred_lft 388sec
    inet6 2a***::1/128 scope global dynamic noprefixroute
       valid_lft 3791sec preferred_lft 2791sec
    inet6 fe***/64 scope link
       valid_lft forever preferred_lft forever
3: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 96******:ab brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.1/24 scope global vmbr0
       valid_lft forever preferred_lft forever
    inet6 fe***/64 scope link
       valid_lft forever preferred_lft forever
4: tap100i0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr0 state UNKNOWN group default qlen 1000
    link/ether 96****** brd ff:ff:ff:ff:ff:ff

Code:
root@proxmox:~# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination      


Chain INPUT (policy ACCEPT)
target     prot opt source               destination      


Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination      


Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination      
MASQUERADE  all  --  10.10.10.0/24        anywhere        
root@proxmox:~# tcpdump -i ens6 host 1.1.1.1
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on ens6, link-type EN10MB (Ethernet), snapshot length 262144 bytes
13:08:38.015708 IP 10.10.10.2 > one.one.one.one: ICMP echo request, id 975, seq 7, length 64
13:08:39.039604 IP 10.10.10.2 > one.one.one.one: ICMP echo request, id 975, seq 8, length 64
13:08:40.063666 IP 10.10.10.2 > one.one.one.one: ICMP echo request, id 975, seq 9, length 64
13:08:41.087676 IP 10.10.10.2 > one.one.one.one: ICMP echo request, id 975, seq 10, length 64
13:08:42.111638 IP 10.10.10.2 > one.one.one.one: ICMP echo request, id 975, seq 11, length 64
^C
5 packets captured
5 packets received by filter
0 packets dropped by kernel


I have now created a VM with Ubuntu 24.04

I have disabled cloud-init and configured it in the /etc/netplan/50-cloud-init-yaml (attached screenshot)

So the IP of the VM is now 10.10.10.2. I can reach 10.10.10.1 via ping, as well as 10.10.10.2 from the Proxmox host

My problem:
The VM has no internet access. I have been sitting on the problem for 5 days now, have reinstalled Proxmox about 5 times and searched the entire internet, as well as this forum. ChatGPT was not much help either. I'm sorry, I suspect that despite all the posts I don't recognize the right approach. This is a duplicate Post from the german support topic: https://forum.proxmox.com/threads/vm-kein-internet-nach-installation.149028/#post-674796

I checked internet access via ping 1.1.1.1 and sudo apt update.

LG Lucas
 

Attachments

  • brave_3hImOHhcLU.png
    brave_3hImOHhcLU.png
    3.8 KB · Views: 4
are you sure about the format of your yaml file /etc/netplan/50-cloud-init-yaml?
every tab are important
Code:
network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - 85.***.**.*/24
            gateway4: 85.***.**.***
            match:
                macaddress: **:**:**:**:**:**
            nameservers:
                addresses:
                - 1.1.1.1
                search:
                - local
            set-name: eth0
 
Last edited:
I tried different variations of the tabs, however without any success. When appliying the netplan there are no errors. My idents are always 4 spacesbrave_Tr1ZP4SHsC.png
 
adrresses and ip need to start at the same line
is it normal u don't have gateway?
Code:
adresses:
- 10.10.10.2/24
 
Also with the address in the same line it does not work.

When using gateway4 netplan says its deprecated and online I found "routes" to be the new superior way.brave_h9GW5iWq1O.pngbrave_m88gDZgWN2.png
 

Attachments

  • brave_8XCvLwalGW.png
    brave_8XCvLwalGW.png
    36.5 KB · Views: 2
Last edited:
"I found "routes to be the new superior way" thx for the info
so everything look good to me
if u didn't check /etc/resolv.conf see if your nameserver is correct
Did you try to "regenerate image" in cloud-init,
- IP CONFIG
- network: ipv4 = static
 
Last edited:
Hey, this is the content of /etc/resolv.conf

What do you mean with "regenerate image"?
The VM image is completely fresh and creating other VMs is the same problem. Cloud-init is deactivated right now, however can reactivate if necessarry.
 

Attachments

  • brave_tSahQVeHiv.png
    brave_tSahQVeHiv.png
    19.1 KB · Views: 2
i think you should have your gateway in /etc/resolv.conf
nameserver 10.10.10.1 (not sure abot that but the gateway or gateway of your internet provider or 8.8.8.8)
nameserver 8.8.4.4
nameserver 8.8.8.8

regenerate cloud-init image (just regenerate the conf file of the VM)
1718699747025.png
IP Config:
- ip=dhcp if your using dhcp
-ip=ipv4 static if not
 
Last edited:

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!