Networking of public IP and VMs

flexelem

New Member
Sep 16, 2022
3
0
1
Dear Experts,

It's been a short time since I met Proxmox and I must say that I am very impressed.

I will try to explain my problem in a very simple way.

I have a data cable from ISP to my house. I don't have a modem.

When I plug the cable into my server and enter the IP addresses provided by the ISP, I can access the internet.

I did the same to my Proxmox server.
I entered the IP given to me by the ISP and my server was connected to the internet.

Currently, I can easily access my server via internet browser vs ssh ports with the public ip that ISP gave me.

Here comes the question.
But the VMs I created do not connect to the internet.

I've read and tried a few instructions but it didn't work.
How can I find a solution. Do we have any expert friends who have worked on a structure on this subject before? Could you please share your recommendations with me?

Thanks in advance,
 
HI flexelem,

do you use any kind of router at all? Can you post the content of the file /etc/network/interfaces? Please put it between [code][/code] tags to preserve formatting.

Thanks!
 
Hello,

Thank you for your return. I have shared the information you requested below. No, I am not using any router. The data cable connects directly to my Proxmox server.

auto lo iface lo inet loopback auto enp3s0f0 iface enp3s0f0 inet manual iface enp3s0f1 inet manual iface enp4s0f0 inet manual iface enp4s0f1 inet manual auto vmbr0 iface vmbr0 inet static address 195.2x4.188.2xx/30 gateway 195.2x4.188.2xx bridge-ports enp3s0f0 bridge-stp off bridge-fd 0 auto vmbr1 iface vmbr1 inet static address 192.168.10.100/24 bridge-ports none bridge-stp off bridge-fd 0
 
Last edited:
Hey,

since you dont use a router you have to configure your Proxmox host to do the translation of IP-Adresses (NAT). Something along the line of

Code:
auto vmbr1
iface vmbr1 inet static
        address 192.168.10.100/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 '192.168.10.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE

The first 'post-up' line makes it so that the host forwards the packets from your local net at all, and the next two lines are for the NAT: replace (masquerade) the source-IP of the local net with the IP of interface vmbr0.

See also here:
https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt

Another option would be to set up your own router inside a VM, which then does all this stuff and offers more firewall-features. PFsense seems to be popular here.
 

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!