Routing between two LAN subnets - sounds simple but isn't working

  • Hi peoples,

    I'm new to pfsense and am trying to set up a new subnet for testing in my VMware ESXi 5.1 environment.

    My network is set up as follows:

    Linux based firewall gateway to internet with modem > WAN / LAN > network with unmanaged gigabit switch.

    My VMware environment is plugged into that switch and I have a distributed switch with two port groups - one with hosts on and the other with hosts on

    I created a VM with three NICs and installed pfsense.  The NICS are named WAN, LAN1 and LAN2 and WAN is configured with no IP and plugged into the port group.  LAN1 is also plugged into same port group and has IP (given .1 and .11 were already in use).  LAN2 is configured with

    I disabled all firewall rules in pfsense since I only need routing, but had rules in place on LAN1 and LAN2 allowing any protocol on LAN1 and LAN2 to any just in case.

    I have a default route set up on LAN1 of to allow access to the internet.

    I can ping all IPs in from hosts in, however from my PC on that network I cannot open remote desktop to my windows VMs on network as it fails to connect.  A look at netstat on the VM shows a connection being received with "SYN_RECEIVED" state.  That, along with a tcpdump show the connection is received by the VM but the responses do not get back, all i saw was one way traffic.

    So from the VM I can ping the pfsense router's interfaces on both LAN1 and LAN2, the default gateway AND the internet, for example google.  Yet ping ANY other hosts on network and the pings time out.  A traceroute shows the first hop as on the pfsense router but * * * beyond that.

    I have tried with no success:

    1)  removing the default gateway on LAN1 and on the router generally
    2)  adding gateways LAN1 and LAN2 192.1.1 on the respective interfaces - even though common sense and the routing table tell me they are not needed.

    I am tearing my hair out trying to work out why this does not work.

    No firewalls are enabled on ANY systems on my LAN so that can be ruled out.

    The default gateway of systems on is and on it is so that all looks fine.

    This should be so simple so whats wrong????

  • LAYER 8 Global Moderator

    For starters the current 2.2.x version of pfsense is not even supported until version 5.5u2

    It is drop dead simple…

    You say you have a "I have a distributed switch"  so your running vcenter with enterprise licensing then?  But you don't have smart/managed switches - really?

    " network with unmanaged gigabit switch."

    But then you have port groups on your vswitch that have both 0.0/24 and 1.0/24 networks on them?  How exactly is that going to work connecting to a dumb physical switch??

    How many physical networks do you have??  That vswitch connected to your physical network is where wan of pfsense should go.  Doesn't seem like you have any other physical networks or vlans since all you have is a dumb switch..  So create new vswitches, no point in them being distributed unless your going to tie them to the physical world which doesn't really seem like you are..

    Then create connect your pfsense lan and opt interfaces to these specific vswitches and connect whatever vms you want on those network segments to the same vswitch..  The gateway of these networks would be the IP of the pfsense interface you have on that vswitch..  I can show you a picture of my setup if helps..

    So the phy int connected to wan vswitch is directly connected to my cable modem... Pfsense get as public IP on this interface.

    vmkern and and lan phy nics are connected to same vlan ports on managed switch.  wlan is connected to trunk port on phy switch and set for all vlans in the vswitch.  On the pfsense interface on its virt interface I run multiple vlans as well as vlans on the AP connected to the phy switches in my network.

    Then last you see the dmz, pfsense as a interface connect to this switch, and as you see its not connected to the physical world...  But devices on this vswitch can route through pfsense interfaces to get to the phy network be it out the internet (wan) or out lan or wlan (and multiple vlans) etc..

    Hope that helps...  But if your running pfsense 2.2.x you need to be on 5.5u2 at min since this is when freebsd 10.1 support was added to esxi.  Not saying it can not work, but there are some odd stuff that could/might happen, etc..  If you want to use pfsense 2.2.x then you really really should be on vsphere version that supports the OS fully..

    I am currently running 6 build 3247720 without any problems at all.

  • Thanks for your reply johnpoz.

    To answer your questions:

    This is a test environment I ran at home for self education purposes and prototyping.  You asked why run diatributed switches and the answer is right there "dustributed" - otherwise my VMs cannot be vmotioned - my cluster is set up as close to enterprise as possible since I set it up to study VCP and build experoence.    At the moment I haven't got a managed switch.  Also my cpus are not supported by 5.5, so 5.1u2 is aa far as I can go although having said that my hardware supposedly can't run 64bit guests yet lo and behold they run fine.

    The only network existing outside vmware is the network. is purely behind the pfsense router.

    I have two seperate port groups on the distributed switch - one has VMs on, the other has VMs with pfsense having an interface on both.

  • LAYER 8 Global Moderator

    you sure and the hell do not have to run distributed switches to vmotion.  Not sure where you got that idea… Not sure where you got the idea your cpu is only support on 5.1u2, u3 isnt even support??  What cpu do you have??

    But you stated you connected both port groups to the same unmanaged switch?  So your running both address schemes over the same layer 2?

    Can your vms connected to the pfsense lan side ping your lan side?  You stated you turned of firewall, so you also disabled nat..  So does your internet router know how to get to the pfsense lan network?  Most likely NOT.. So you would have to create a route on your internet

    I have a default route set up on LAN1 of to allow access to the internet.

    Then it is NO Longer lan interface if you set a default gateway on it...

    What exactly are you trying to do?

    "LAN2 and WAN is configured with no IP and plugged into the port group."

    What are they going to do with no IPs?  How is pfsense going to route anything if only has 1 interface with an IP?

    Draw a picture please and state what exactly you want to happen.. Not sure how pfsense is going to do anything with an IP in only 1 network???

  • According to the compatibility matrix only 5.1 supports my CPUs which are opteron 285s with no virtualization instruction sets.

    I was always under the belief that vswitches exist on the host only and don't talk across hosts and hence the distributed switch is used.  I haven't used vswitches since esx 3.5 and vsphere 4 days.

    My Internet router has a static route to gateway
    and I set up the default route on the LAN1 side of pfsense of because I assumed it needed that to Know where to send any traffic for networks it does not know about.

              (                                                          /                     
                                   VMs---Portgroup( VMs
                                                                                              \                        /
                                                                      ( LAN2--pfsense--LAN1 (

    Does that make sense now?  So everything exists only inside Vsphere on the LAN2 side.

    The whole thing with WAN interface being configured was another attempt to get this working.  My first attempt was WAN and LAN but when it was not routing as expected I thought maybe this product is intended as an internet / LAN router needing NAT to route to WAN and I needed to use only LAN interfaces to allow routing between two LANs.  So I set up WAN unconfigured and just used two LAN interfaces - however that didn't work either and here I am now. :)

  • The thing that I find bizarre about all this is that hosts on network can ping, and receive replies from, hosts in

    Yet hosts on cannot ping any hosts on EXCEPT the pfsense routers IP IP and the gateway even when that is not set as the default route on the pfsense router.

    Routing is working in one direction > and receiving the replies (at least for ICMP pings, not for actual connections such as RDP) yet not in the other.

    No firewalls whatsoever in the way.

  • LAYER 8 Global Moderator

    Dude what is the make and model of your hardware this cpu is in?  And where are you looking?

    If I look here an opteron 2xx

    Only supports 3.5 not 5 if your your running 5, then you can run 6..

    Not sure how you configured, but why do you have 2 port groups tied to your physical network??  And not using vlans?  Your just putting 2 different address schemes on the same physical wire than… They are all in the same layer 2..

    Again lets ask this another way -- what exactly are you trying to accomplish here?  Why not just put all your vms in ??

    If you want to use pfsense to route and or firewall..  Then do that..  Put pfsense wan in the network.. Create 2 or 3 or ++++ new segments put them in their own vlan with their portgroup.  If your wanting to connect your hosts and isolate vms into their own networks then you need a switch that supports vlans.  Or you have to use isolated switches... You can not just plug everything into 1 dumb switch and use different address space on them..

    You say your trying to simulate an enterprise setup, but you don't have a vlan capable switch?  And your hosts only have 1 nic?

  • I can now rule out sharing two network ranges over one switch - I created a second distributed switch and moved the network onto that distributed switch with no external uplinks.  Now no traffic for is on a switch used by

    Still doesn't work.  Same identical issue.

    As far as what I am trying to achieve - I want to create an isolated Windows test domain isolated from the rest of my network where it can be responsible for DNS and DHCP without affecting my existing setup.

    As far as my setup is concerned cost is an issue, hence I have not bought managed switches.  I had existing layer 2 switches so I made use of them.  If I was to buy a switch it would have to be cisco so I could learn more about the industry standard.

    For the record my specialization is UNIX/Linux.  I haven't done networking since before VLANs and a lot has changed.

  • LAYER 8 Global Moderator

    Dude lets do some basics here..

    Lets do so basics.. this really should be clickity clickity.. I have been running pfsense on esxi since version 5 of esxi and has always just been clickity clickity to get it working..

    So your physical network is so connect pfsense wan to this network..

    Then on your new vswitch be it d or just standard connect your pfsense lan interface..  Lets use say since you have not mentioned this network.  Put a vm in this same vswitch and it should get an IP address from pfsense dhcp server..  If it doesn't then you got something wrong.

    Once you have wan/lan working.. You know have your isolated network..  Once you have it working with NAT, and your clients can get to your wan… Then you can turn worry about turning off nat if you want..

    Again keep in mind pfsense 2.2 is NOT supported by your OLD as the hills version of esxi..  Your not installing the vmware tools are you??

Log in to reply