VM access from outside

Suntory

New Member
Dec 19, 2022
1
0
1
Hello,

I would like to get acces to a VM from outside my home network. I have installed Home assisant.

My /etc/network/interfaces file :

auto lo
iface lo inet loopback


iface enp2s0 inet manual


auto enp2s0
iface enp2s0 inet static
address 192.168.1.25 //this is the ip address of my proxmox server
netmask 255.255.255.0
gateway 192.168.1.1
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/enp2s0/proxy_arp


auto vmbr0
iface vmbr0 inet static
address 192.168.1.25/24
gateway 192.168.1.1
bridge-ports enp2s0
bridge-stp off
bridge-fd 0

sdfdsf.png


And I follow this tutorial for port forwarding and the configuration of duckdns inside home assistant : https://www.youtube.com/watch?v=AK5E2T5tWyM

My router interface Nat (see attached file)
I opened the ports on my router by redirecting to HA's ip address:


my file : configuration.yaml of Home assistant

homeassistant:
external_url: https://my-domain.duckdns.org:8123
internal_url: https://my-domain.duckdns.org:8123

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

I can access to home assistant inside of my network but not from outside ...

I check my port forwarding and it work :
https://canyouseeme.org/

I think the problem come from to interfaces file but ... I'm not sure ...
 

Attachments

  • Capture d’écran du 2022-12-19 14-39-02.png
    Capture d’écran du 2022-12-19 14-39-02.png
    22.2 KB · Views: 11
Last edited:
Hello,

I would like to get acces to a VM from outside my home network. I have installed Home assisant.

My /etc/network/interfaces file :

auto lo
iface lo inet loopback


iface enp2s0 inet manual


auto enp2s0
iface enp2s0 inet static
address 192.168.1.25 //this is the ip address of my proxmox server
netmask 255.255.255.0
gateway 192.168.1.1
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up echo 1 > /proc/sys/net/ipv4/conf/enp2s0/proxy_arp


auto vmbr0
iface vmbr0 inet static
address 192.168.1.25/24
gateway 192.168.1.1
bridge-ports enp2s0
bridge-stp off
bridge-fd 0

View attachment 44630


And I follow this tutorial for port forwarding and the configuration of duckdns inside home assistant : https://www.youtube.com/watch?v=AK5E2T5tWyM

My router interface Nat (see attached file)
I opened the ports on my router by redirecting to HA's ip address:


my file : configuration.yaml of Home assistant

homeassistant:
external_url: https://my-domain.duckdns.org:8123
internal_url: https://my-domain.duckdns.org:8123

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

I can access to home assistant inside of my network but not from outside ...

I check my port forwarding and it work :
https://canyouseeme.org/

I think the problem come from to interfaces file but ... I'm not sure ...
As soon as a NIC is defined as bridge port (in the current case enp2s0@vmbr0) it must not have configured an IP any more. Moreover, since you have just one network ip_forward is not necessary, VMs are contacted directly by layer 2 (i.e. via MAC address) from the router. Port forwarding to VMs have then configured in router as it has to be done for any physical machine in the network (here it's 192.168.1.0/24), assuming VM's IP address is also in this subnet.
 

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!