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

    Static route VS firewall rule

    Scheduled Pinned Locked Moved Routing and Multi WAN
    14 Posts 3 Posters 783 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.
    • R
      rcoleman-netgate Netgate @Nick Wollman
      last edited by

      @nick-wollman said in Static route VS firewall rule:

      So I would think that adding a static route would not automatically allow all the traffic to go over that route, but it seemed to me like that's the case here.

      All matching traffic on a static route should use that route. A common example of one you didn't know you add is when you put a monitoring IP on a gateway -- then all the traffic to that IP (typically a DNS server because they're snappy to respond) will go through that gateway.

      Ryan
      Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
      Requesting firmware for your Netgate device? https://go.netgate.com
      Switching: Mikrotik, Netgear, Extreme
      Wireless: Aruba, Ubiquiti

      N 2 Replies Last reply Reply Quote 0
      • N
        Nick Wollman @rcoleman-netgate
        last edited by

        @rcoleman-netgate

        By "all traffic matching that route", is that true without any firewall rule that specifies that gateway?

        In my case, without the static route, no firewall rule will get traffic to that destination, even if the gateway is specified in that rule.

        R 1 Reply Last reply Reply Quote 0
        • R
          rcoleman-netgate Netgate @Nick Wollman
          last edited by

          @nick-wollman Static routes are made when you create and establish a VPN a static route is made to support that VPN. That is traffic that routes without the aid of a firewall rule specifying a gateway.

          Ryan
          Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
          Requesting firmware for your Netgate device? https://go.netgate.com
          Switching: Mikrotik, Netgear, Extreme
          Wireless: Aruba, Ubiquiti

          N 1 Reply Last reply Reply Quote 0
          • N
            Nick Wollman @rcoleman-netgate
            last edited by

            @rcoleman-netgate

            Ok, in my case i am doing a site to site vpn. I want certain devices here, to be able to reach over there. As soon as i define a static route, ALL my devices here can reach over there. How do I control that?

            And what is the gateway option for in a firewall rule?

            R 1 Reply Last reply Reply Quote 0
            • R
              rcoleman-netgate Netgate @Nick Wollman
              last edited by

              @nick-wollman You have a few options...

              1. Put those in their own block and pass that block through the site-to-site
              2. Dictate their IPs as part of the site-to-site
              3. make a rule that pushes those source IPs (as a host alias) through with a custom gateway.

              You may need to have Outbound NAT set as well.

              @nick-wollman said in Static route VS firewall rule:

              And what is the gateway option for in a firewall rule?

              Under Advanced at the bottom of the rule.

              Ryan
              Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
              Requesting firmware for your Netgate device? https://go.netgate.com
              Switching: Mikrotik, Netgear, Extreme
              Wireless: Aruba, Ubiquiti

              1 Reply Last reply Reply Quote 0
              • N
                Nick Wollman
                last edited by

                Thanks for the reply.

                1-2. OK this is actually a viable option to specify the allowed IPs in the tunnel. Or segregate the devices and allow only them in the tunnel.

                1. OK this is what I thought would be the best way to do it, but what I’m saying is that this doesn’t work. If I understand correctly, I should make a Firewall Rule that specifies a custom gateway in the advanced settings of that firewall rule. I have tried to do this, but it doesn’t work. No traffic matches that rule. And it does not work without a static route. In fact, it doesn’t work at all.
                R 1 Reply Last reply Reply Quote 0
                • R
                  rcoleman-netgate Netgate @Nick Wollman
                  last edited by

                  @nick-wollman Are you passing the alias in Outbound NAT, too?

                  Set Source to Network and enter your hosts alias.
                  91d97468-4c23-4e86-80ab-0349ddcfc278-image.png

                  Ryan
                  Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
                  Requesting firmware for your Netgate device? https://go.netgate.com
                  Switching: Mikrotik, Netgear, Extreme
                  Wireless: Aruba, Ubiquiti

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    Nick Wollman @rcoleman-netgate
                    last edited by

                    @rcoleman-netgate said in Static route VS firewall rule:

                    @nick-wollman said in Static route VS firewall rule:

                    So I would think that adding a static route would not automatically allow all the traffic to go over that route, but it seemed to me like that's the case here.

                    All matching traffic on a static route should use that route. A common example of one you didn't know you add is when you put a monitoring IP on a gateway -- then all the traffic to that IP (typically a DNS server because they're snappy to respond) will go through that gateway.

                    BTW this seems like weird behavior. All traffic for that monitor IP will use that gateway? Why?

                    1 Reply Last reply Reply Quote 0
                    • N
                      Nick Wollman @rcoleman-netgate
                      last edited by

                      @rcoleman-netgate

                      Well, I followed the WireGuard site to site tunnel video, and in there it said, to not specify an upstream gateway, so I don’t have to use NAT. Currently, if I reach a device on the other side of the tunnel, it is seeing my actual IP on my LAN here, exactly how Christian McDonald did it.

                      No good?

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        rcoleman-netgate Netgate @Nick Wollman
                        last edited by

                        @nick-wollman Do what Christian tells you to.

                        Ryan
                        Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
                        Requesting firmware for your Netgate device? https://go.netgate.com
                        Switching: Mikrotik, Netgear, Extreme
                        Wireless: Aruba, Ubiquiti

                        1 Reply Last reply Reply Quote 0
                        • N
                          Nick Wollman
                          last edited by

                          Ok. I did. And now I post here, because the static route is too permissive, and restrictive firewall rule doesn’t work.

                          Can anyone help?

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