Score:0

Setting Up WAN + LAN Network with pfSense in VirtualBox - Troubleshooting TCP Connection Issue

mm flag

Hello,

I am currently in the process of configuring a WAN + LAN network within VirtualBox using pfSense (VM) as the router in my LAN. The primary objective is to establish communication between a TCP client program on the host machine (WAN) and a server program on my Ubuntu VM (LAN). All communication is intended to pass through pfSense.

Issue

I have encountered an issue where the client/server programs, implemented as Python scripts utilizing socket connections, are generating a Connection refused error when using the connect() function. This suggests a problem with port availability. Let's delve into the details of my setup.

Network Overview

For my pfSense VM, I have configured two network interfaces: the first is set up as a bridge, while the second operates within an internal network. My Ubuntu VM is located within the internal network. Promiscuity mode is set to allow all on both interfaces.

pfSense Configuration Overview

My pfSense VM is assigned a static IP address of 192.168.50.1/24, with DHCP set up for the LAN. Here's a screenshot of the pfSense configuration. On the pfSense dashboard, I have disabled traffic blocking on the WAN interface, as shown here. I have added a firewall rule on the WAN interface to allow all requests, while the defaults are maintained for the LAN interface, depicted here. Additionally, I've implemented NAT port forwarding from port 50042 to 50042, which is used by my client/server program. Port forwarding settings are illustrated. The remaining settings are at their default values.

Ubuntu VM Configuration Overview

The network settings for my Ubuntu VM are automatically configured through DHCP. The settings can be viewed here.

Routing Overview

All machines within my setup can ping each other and access the internet. A traceroute from my Ubuntu VM to the host machine shows that the path traverses through pfSense, as indicated here. However, when attempting a traceroute from the host machine to the Ubuntu VM, the traffic bypasses pfSense, as seen here.

Additional Tests

I conducted further tests, including altering VirtualBox network interface settings with NAT networking to establish port forwarding directly within VirtualBox. I also experimented with a host-only network and attempted to modify pfSense interface settings. Unfortunately, these attempts disrupted the routing configuration.

I sincerely appreciate your assistance in resolving this matter.

Thank you.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.