I’m trying to setup one VM with an open source firewall/router OS (OPNsense) and another VM with Ubuntu to act as a client on that same network. This is fairly simple to do in VirtualBox:
– OPNsense VM: Create two network interfaces, one that is bridged to my host machine’s network adapter and another for the “internal” network to the VM environment.- Ubuntu VM: Create a network interface that is connected to the same “internal” network as the OPNsense VM.
Reading the help file for VMWare Fusion, I assumed I could do the same as it states for the “Private to my Mac” network option:
>When you use this type of network connection, the virtual machine is connected to your Mac’s operating system on a virtual private network, which normally is not visible outside your Mac. **Multiple virtual machines configured with host-only networking on the same Mac are on the same network.**
So I tried to create a similar setup as I had in VirtualBox:
– OPNsense VM: Create two network interfaces, one that is bridged to my host machine’s network adapter and the other set to “Private to my Mac”.- Ubuntu VM: Create one network interface that is set to “Private to my Mac”.
However, the two VMs appear to be on two separate networks. The IP address assigned to the second network adapter for OPNsense is [192.168.1.1](https://192.168.1.1) and the IP address for the Ubuntu VM is [192.168.254.1](https://192.168.254.1).
Any ideas on how I can get these two VMs on the same private/virtual network?
Edit: So I manually edited the network file to turn DHCP off for the ‘Private to my Mac’ network, restarted the VMs a few times and now these are the IP addresses being assigned:
– OPNsense VM: [192.168.1.1](https://192.168.1.1)- Ubuntu VM: [192.168.1.100](https://192.168.1.100)
But, it still doesn’t look like they’re on the same network. From the Ubuntu VM, I can’t access the OPNsense VM web GUI but when I ping [192.168.1.1](https://192.168.1.1), I get a response. However, I get a response even if the OPNsense VM is shut down. From the OPNsense VM, I cannot ping [192.168.1.100](https://192.168.1.100), so it looks like they’re still two separate networks despite the IP address being on the same subnet.
***Solution***: Thanks to /u/SUBnet192 for the tip. It appears the VMware Fusion virtual network has a DHCP server running that was conflicting with OPNsense. I simply logged into OPNsense from the VM and let the LAN interface reassign its IP address via DHCP and it changed from [192.168.1.1](https://192.168.1.1) to [192.168.1.128](https://192.168.1.128).
However, the second issue was figuring out how to turn off the VMware Fusion virtual DHCP server and router. I’m trying to get my Ubuntu VM to use the OPNsense VM as the DHCP server, router and firewall. There doesn’t appear to be any GUI option to do this but after doing some Google searching, here’s how to disable it:
1. Browse to /Library/Preferences/VMware Fusion and open the file called ‘networking’. Example below.
2. Change the VNET_1_DHCP from ‘yes’ to ‘no’ for the adapter that is your “internal” VMware network. Depending on how you have your network adapters added, one of them is for the “Private to my Mac” (i.e. internal virtual network) and the other is for the “Bridge” adapter. Likely the one that has the VNET_X_NAT line is the one that is setup for the Bridge adapter.
3. Save the file, restart VMware Fusion.
4. Reconfigure OPNsense with a manual IP address on the LAN interface.
answer VNET_1_DHCP yes
answer VNET_1_DHCP_CFG_HASH XXXX
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 192.168.1.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP yes
answer VNET_8_DHCP_CFG_HASH XXXX
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.2.0
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes
add_bridge_mapping en1 2
To see the full content, share this page by clicking one of the buttons below