Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    InterVLAN Routing Failing When Assigning Different Gateway

    Scheduled Pinned Locked Moved Routing and Multi WAN
    10 Posts 4 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      abeauchamp
      last edited by

      Hello all,

      I am trying to figure out an issue with inter-vlan routing when there are multiple WAN connections, each with its own gateway.

      My pfSense box has 3 ports on it, em0 is connected to WAN1 cable modem, em1 is connected to WAN2 modem, and em2 is connected to an HP-2530-48G switch, with 4 subinterfaces on it, VLAN 10, 11, 12, 200.

      VLAN 11 is the office DATA VLAN and VLAN 200 is the VLAN used for managing 4 Ubiquti Unifi access points. The default gateway is set as WAN1's gateway under the Routing menu, but I need traffic in VLAN 11 to go out over WAN2's gateway not the default gateway. Once I create a firewall rule, all traffic going out to use WAN2 gateway from VLAN 11 using the advanced gateway option in the rule, I am no longer able to access the resources, AKA SSH into the Unifi access points or the controller, in VLAN 200. If I change that rule to use the default gateway again, I am able to access resources in VLAN 200.

      How do I set it up so that traffic from VLAN11 goes out WAN2 gateway, but I am also still able to access the resources in VLAN200. It seems that once I change the gateway I am breaking inter-vlan routing. I feel it is just something I am not doing right on my end.

      Any ideas?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • V Offline
        vindenesen
        last edited by

        Hi abeauchamp,

        Can you take a screenshot of the firewall rules on your VLAN11 interface, and the settings of the rule that you used to route traffic from VLAN11 out WAN2 please? Do you perhaps have set destination to any?

        Support the project by buying a Gold Subscription at https://portal.pfsense.org
        Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

        1 Reply Last reply Reply Quote 0
        • A Offline
          abeauchamp
          last edited by

          I do believe the destination is set to any.  I am not in front of a computer right now to get screenshots.

          What would I need to set the destination to in this situation?

          1 Reply Last reply Reply Quote 0
          • V Offline
            vindenesen
            last edited by

            If the destination is set to any, the ordering of the rules are very important. For instance, maybe the rule to allow access from VLAN11 to VLAN200 comes after the rule where you specify a gateway to be used? A screenshot of your rules on the VLAN11 interface would be helpful.

            When destination is set to any, you are in fact allowing access to all networks/interfaces, unless you have deny-rules that comes first.

            Support the project by buying a Gold Subscription at https://portal.pfsense.org
            Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

            1 Reply Last reply Reply Quote 0
            • A Offline
              abeauchamp
              last edited by

              Make sense.  I am not sure how I can craft a rule for a destination out on the internet.  Maybe a rule that is matched on destination not being an alias of my internal networks?

              1 Reply Last reply Reply Quote 0
              • A Offline
                abeauchamp
                last edited by

                Once I have access to the system tomorrow I will post screenshots.

                Thank you for your help so far.

                1 Reply Last reply Reply Quote 0
                • V Offline
                  vindenesen
                  last edited by

                  The way I did it to allow access to the Internet and not any of my local networks, is to create an alias containing all my local networks (including the WAN IP), lets call the alias for Local_Networks. Then I created a rule that has destination set to "not Local_Networks".

                  Support the project by buying a Gold Subscription at https://portal.pfsense.org
                  Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    heper
                    last edited by

                    @abeauchamp it is working as it should. you are forcing ALL your traffic through a specific gateway…. this results in being unable to contact your other LAN networks.

                    as @vindenesen said, create an alias for your LAN subnets. then put a new rule above your current one (proto: any src:any, dest: alias, gateway: * )

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      Supermule Banned
                      last edited by

                      Why not just use outbound NAT to route the traffic via WAN2?

                      1 Reply Last reply Reply Quote 0
                      • V Offline
                        vindenesen
                        last edited by

                        @Supermule:

                        Why not just use outbound NAT to route the traffic via WAN2?

                        Wouldn't he still need a rule to route the traffic out WAN2, when the default gateway is on WAN1?

                        Support the project by buying a Gold Subscription at https://portal.pfsense.org
                        Running pfSense on SuperMicro A1SRI-2758F with ESXi 5.5

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.