Easiest way to setup private switch for a private network for test vms

kumarullal

Member
Jun 17, 2009
162
0
16
LA, USA
Can someone suggest steps in setting up easiest method by which I can create a private virtual switch for my vms , that will grab ip from dhcp setup specially for the private network.
Basically, I want to test out some DHCP and GIT setup. I already have a DHCP server on my main subnet. Therefore I want a private network /subnet, that will not interfere to my main network.
Also if possible, if there is a need to download/install some packages from the internet, there should be a gateway through vmbr0 or vmbr1.
Thanks in advance.
 

symmcom

Well-Known Member
Oct 28, 2012
1,077
26
48
Calgary, Canada
www.symmcom.com
Easiest and effective way i would do it is by creating a virtual machine with firewall and attach 2 virtualNIC. One for your default bridge (ex: vmbr0) and second interface to connects to a new bridge say vmbr10. Then you connect your test VM to that new bridge. The virtual firewall will act as router between your test VMs and main network. There are other way to do it. But i prefer this way. Not too much main host interfaces.
 

pirateghost

Member
Apr 25, 2013
454
8
18
Thanks Mir,
Can you provide some pointers. Some instructions, may be.
Thanks
Create a vmbr# (pick any number you like), do not give it an IP and do not attach it to any devices

Install a firewall/router distro in a KVM (I prefer VyOS)

For the VM, assign eth0(VM setting, not host network setting) to vmbr0, and assign eth1 to your new vmbr

Set up your router distro in the VM.

Eth0 would be WAN, eth1 will be LAN(new private network for testing)

Install a client VM, and attach its nic to vmbr# that you made. It will now only get internet access through your router/firewall distro, and is on its own network, separate from your main LAN
 

kumarullal

Member
Jun 17, 2009
162
0
16
LA, USA
Thanks Pirateghost. That is exactly what I did. I created a vmbr10 with different subner, and not attached to any device. I created an ubuntu kvm with 2 nic and attached eth0 to vmbr0 and eth10 to vmbr10. I set IPV4 forward to 1 o the routing could happen. Everything works great.
Thanks everyone
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!