How do I get a LAN-only virtual machine?

odroid

New Member
Nov 27, 2021
5
0
1
45
Hello everyone,

I'm using the latest version of Proxmox and everything works.
thank you to the whole community for your work and support.

I have a question that is not trivial ^^

I would like to create a VM but without it connecting to the internet during installation but while keeping the local network connection.

The current network configuration is:


Code:
GNU nano 5.4 /etc/network/interfaces

self lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
         address 192.168.0.13/24
         gateway 192.168.0.1
         bridge-ports eno1
         bridge-stp off
         bridge-fd 0

the network configuration is original, I have not modified anything.

Thank you all
 

Attachments

  • Capture d’écran 2022-02-09 à 16.57.21.png
    Capture d’écran 2022-02-09 à 16.57.21.png
    139.4 KB · Views: 36
Last edited:
Hi,
I think you can give the vm a "wrong" standardgateway (which is not pointing to the internet) / no gateway.

Why would you like to do it?
 
yes but if I remove the getaway the other VMs will not have internet.

I just want to prevent an internet connection on a single VM.

Thanks
 
You would leave the gateway on the host,

@mcdaniels advised you to give the 'isolated' vm either a wrong gateway or no gateway at all - this would allow traffic between LAN and VM but prevent the VM reaching the internet.
 
You would leave the gateway on the host,

@mcdaniels advised you to give the 'isolated' vm either a wrong gateway or no gateway at all - this would allow traffic between LAN and VM but prevent the VM reaching the internet.
Thank you for your reply.

Sorry but I don't know how to do it, should I edit: /etc/network/interfaces or is it another method?

Thank you
 
Thank you for your reply.

Sorry but I don't know how to do it, should I edit: /etc/network/interfaces or is it another method?

Thank you
If we are talking about the vm which should be isolated, you can do it in /etc/network/interfaces (depending on the os of the isolated vm -- interfaces files = "e.g. Linuxderivates").

Don't remove / alter the gateway on the Proxmox-VE, this would lead to the behaviour you are talking about (other vms lose internetconnection). Alter/remove the gateway on the VM which should not have internetaccess at all.
 
Generally, to enable internet access a VM needs
1. VM Hardware config includes a NIC
2. VM NIC is attached to a Vmbr bridge
3. VMbr needs to be attached to an operational physical NIC on the host or to a device which will route network traffic
4. The host o/s of the VM needs a driver for the virtual NIC and a valid IP configuration needs to exist on the o/s deployed on the VM

Any one of those 4 conditions is not met, then the VM cannot access the internet. A gateway for a VM is normally defined and set during the installation of the operating system

Or are you referring to containers rather than VM's?