Issue with connecting VM to Internet

Started by dalibor, February 12, 2023, 05:08:13 PM

Previous topic - Next topic
February 12, 2023, 05:08:13 PM Last Edit: February 12, 2023, 05:18:26 PM by dalibor
Hello all
After lot of searching and trying I decided to ask for help on this forum.

In short, I have VMware Worstation installed on my desktop PC (Linux Mint21) and there I have VM OPNsense and another VM "TestVM" in different subnet. The problem is that I cannot connect VM "TestVM" to internet.

I'll try to put here as much details as possible to have clear picture of the environment (please see attacment).

Router IP: 192.168.0.1
Desktop PC (physical): 192.168.0.100/24

VMware Workstation 16 PRO:
vmnet0 - Bridge: 192.168.0.0/24
vmnet8 - Host-Only: 192.168.1.0/24

OPNSense:
WAN interface connected to vmnet0 (Bridge), IP: 192.168.0.254/24, GW: 192.168.0.1
LAN interface connected to vmnet8 (Host-Only), : IP: 192.168.1.254/24

VM "TestVM":
IP: 192.168.1.6/24
GW: 192.168.1.254

I'm accessing the OPNsense management GUI on IP 192.168.1.254.

I created rule to pass from LAN to WAN and vice versa, played with gateways on LAN interface, I cannot get it to work.
I can ping the TestVM from my desktop PC - 192.168.0.100 -> 192.168.1.6.
I can ping the my desktop PC from TestVM - 192.168.1.6 -> 192.168.0.100.

However, I cannot ping the router from TestVM: 192.168.1.6 -> 192.168.0.1. Here in FW logs I see that the traffic is allowed, but I'm not getting ping response.
Also I cannot ping the OPNsense WAN interfase from my desktop PC (192.168.0.100 -> 192.168.0.254) and aslo from the router (192.168.0.1 -> 192.168.0.254 (same subnet)

I cannot figure it out what I'm doing wrong, so I really appreciate some help/advice.
Thank you in advance.







First off, you don't need to add any rules or gateways on the LAN for this to work.
A default install will give you internet access from the LAN interface.
So 'undo' everything you 'tried', or better yet, just start over with a fresh install.

Then go to interfaces/WAN and uncheck block private networks.
Save/Apply.

For future reference, when you have a problem like this, cut it in half. go into the gui first. See if you have internet from there.
If not, you just cut your network in half and you know the problem is not on the LAN.

Hi Demusman, thank you for reply...

I did what you said, I reset the OPNsense to factory defaults and stated from begining. I left the default settings and yes, I was able to connect to Internet from LAN, thank you for the tip.

However, the WAN interface was configured via DHCP, when I set fixed IP config with manually added gateway for WAN, I lost the connection to Internet again.

After some playing, I found out that for WAN interface I must explicitly set the gateway in the WAN configuration, previously it was set to Auto-Detect and this was it was not working.

Anyway, thank you very mush, problem solved.
Cheers!

Hi!

I also have same issue here :
I have WAN , LAN and OPT networks
WAN -192.168.1.254
LAN - 192.168.10.10/24
OPT - 192.168.20.10/24

I have connected Win VM through LAN and see IP assigned as enabled DHCP on Opnsense .  See Ip assigned to WIn VM 192.168.10.11 with default gateway of OPnsense 192.168.10.10 . Already disbaled option in WAN interface to block private network. Still dont have access to internet . Any help please . Thanks

> Already disbaled option in WAN interface to block private network.
Normally not needed and is best to keep it enabled.

Have you enabled Unbound, and on "All interfaces" (recommended) ?

Quote from: cookiemonster on December 15, 2024, 12:29:16 AM> Already disbaled option in WAN interface to block private network.
Normally not needed and is best to keep it enabled.
Even with a WAN IP in the 192.168.xxx range?

Quote from: EricPerl on December 15, 2024, 08:37:49 PM
Quote from: cookiemonster on December 15, 2024, 12:29:16 AM> Already disbaled option in WAN interface to block private network.
Normally not needed and is best to keep it enabled.
Even with a WAN IP in the 192.168.xxx range?
My bad, I missed that completely. Thanks for pointing it out.