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

    Routing or pass-through?

    Scheduled Pinned Locked Moved Routing and Multi WAN
    23 Posts 3 Posters 4.4k 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.
    • luckman212L Offline
      luckman212 LAYER 8
      last edited by

      Well yes that is expected if you have a pass rule with proto "any" (which includes ICMP of course).  Make your rules more specific (e.g. for Samba you could define an Alias for ports 137-139 and 445 and then allow tcp/udp using that alias. Or if you simply want to block ping (icmp) then add some block rules for ICMP and put them at the top, above your other rules.

      edit: johnpoz replied while I was typing… sorry john didn't mean to leapfrog you

      1 Reply Last reply Reply Quote 0
      • C Offline
        c4bcons
        last edited by

        Really great responses, thank you.  It's a learning thing for me, I've managed loads of network infrastructure projects, but I don't go down to this level as I have experts to do that stuff.  Very interesting.  I have a network diagram at home, I'll post the information this evening.  The switches are Netgear GS108E, I have set up tagged vlans, and the pfsense box also tags traffic.  More detail this evening.

        1 Reply Last reply Reply Quote 0
        • johnpozJ Online
          johnpoz LAYER 8 Global Moderator
          last edited by

          Don't forget your firewall rules..

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

          1 Reply Last reply Reply Quote 0
          • C Offline
            c4bcons
            last edited by

            hopefully my attachment with the network diagram works.  It's colour coded to show the tagged vlans.
            the vlan tags are here:

            Interface VLAN tag Priority Description
            igb0 (lan) 1 0 Home Network VLAN
            igb2 (opt1) 2 Gaming Network
            igb3 (opt2) 3 Home Entertainment VLAN
            igb4 (opt3) 4 Wireless VLAN

            pfSense
            System
            Interfaces
            Firewall
            Services
            VPN
            Status
            Diagnostics
            Gold
            Help
            DiagnosticsCommand Prompt
            Shell Output - pfctl -sr
            scrub on igb1 all fragment reassemble
            scrub on igb0 all fragment reassemble
            scrub on igb2 all fragment reassemble
            scrub on igb3 all fragment reassemble
            scrub on igb4 all fragment reassemble
            anchor "relayd/" all
            anchor "openvpn/
            " all
            anchor "ipsec/" all
            block drop in log quick inet from 169.254.0.0/16 to any label "Block IPv4 link-local"
            block drop in log quick inet from any to 169.254.0.0/16 label "Block IPv4 link-local"
            block drop in log inet all label "Default deny rule IPv4"
            block drop out log inet all label "Default deny rule IPv4"
            block drop in log inet6 all label "Default deny rule IPv6"
            block drop out log inet6 all label "Default deny rule IPv6"
            pass quick inet6 proto ipv6-icmp all icmp6-type unreach keep state
            pass quick inet6 proto ipv6-icmp all icmp6-type toobig keep state
            pass quick inet6 proto ipv6-icmp all icmp6-type neighbrsol keep state
            pass quick inet6 proto ipv6-icmp all icmp6-type neighbradv keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type echorep keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type routersol keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type routeradv keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type neighbrsol keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type neighbradv keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type echorep keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type routersol keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type routeradv keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type neighbrsol keep state
            pass out quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type neighbradv keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type echoreq keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type routersol keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type routeradv keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type neighbrsol keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to fe80::/10 icmp6-type neighbradv keep state
            pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type echoreq keep state
            pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type routersol keep state
            pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type routeradv keep state
            pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type neighbrsol keep state
            pass in quick inet6 proto ipv6-icmp from ff02::/16 to fe80::/10 icmp6-type neighbradv keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type echoreq keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type routersol keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type routeradv keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type neighbrsol keep state
            pass in quick inet6 proto ipv6-icmp from fe80::/10 to ff02::/16 icmp6-type neighbradv keep state
            block drop log quick inet proto tcp from any port = 0 to any label "Block traffic from port 0"
            block drop log quick inet proto udp from any port = 0 to any label "Block traffic from port 0"
            block drop log quick inet proto tcp from any to any port = 0 label "Block traffic to port 0"
            block drop log quick inet proto udp from any to any port = 0 label "Block traffic to port 0"
            block drop log quick inet6 proto tcp from any port = 0 to any label "Block traffic from port 0"
            block drop log quick inet6 proto udp from any port = 0 to any label "Block traffic from port 0"
            block drop log quick inet6 proto tcp from any to any port = 0 label "Block traffic to port 0"
            block drop log quick inet6 proto udp from any to any port = 0 label "Block traffic to port 0"
            block drop log quick from <snort2c>to any label "Block snort2c hosts"
            block drop log quick from any to <snort2c>label "Block snort2c hosts"
            block drop in log quick proto tcp from <sshlockout>to (self) port = ssh label "sshlockout"
            block drop in log quick proto tcp from <webconfiguratorlockout>to (self) port = https label "webConfiguratorlockout"
            block drop in log quick from <virusprot>to any label "virusprot overload table"
            pass in quick on igb1 inet6 proto udp from fe80::/10 port = dhcpv6-client to fe80::/10 port = dhcpv6-client keep state label "allow dhcpv6 client in WAN"
            pass in quick on igb1 proto udp from any port = dhcpv6-server to any port = dhcpv6-client keep state label "allow dhcpv6 client in WAN"
            pass out quick on igb1 proto udp from any port = dhcpv6-client to any port = dhcpv6-server keep state label "allow dhcpv6 client out WAN"
            block drop in log quick on igb1 from <bogons>to any label "block bogon IPv4 networks from WAN"
            block drop in log quick on igb1 from <bogonsv6>to any label "block bogon IPv6 networks from WAN"
            block drop in log on ! igb1 inet from 86.23.0.0/18 to any
            block drop in log inet from 86.23.57.232 to any
            block drop in log on igb1 inet6 from fe80::208:a2ff:fe0a:ba33 to any
            block drop in log quick on igb1 inet from 10.0.0.0/8 to any label "Block private networks from WAN block 10/8"
            block drop in log quick on igb1 inet from 127.0.0.0/8 to any label "Block private networks from WAN block 127/8"
            block drop in log quick on igb1 inet from 172.16.0.0/12 to any label "Block private networks from WAN block 172.16/12"
            block drop in log quick on igb1 inet from 192.168.0.0/16 to any label "Block private networks from WAN block 192.168/16"
            block drop in log quick on igb1 inet6 from fc00::/7 to any label "Block ULA networks from WAN block fc00::/7"
            pass in on igb1 proto udp from any port = bootps to any port = bootpc keep state label "allow dhcp client out WAN"
            pass out on igb1 proto udp from any port = bootpc to any port = bootps keep state label "allow dhcp client out WAN"
            pass in quick on igb0 inet proto udp from any port = bootpc to 255.255.255.255 port = bootps keep state label "allow access to DHCP server"
            pass in quick on igb0 inet proto udp from any port = bootpc to 192.168.1.1 port = bootps keep state label "allow access to DHCP server"
            pass out quick on igb0 inet proto udp from 192.168.1.1 port = bootps to any port = bootpc keep state label "allow access to DHCP server"
            pass in quick on igb2 inet proto udp from any port = bootpc to 255.255.255.255 port = bootps keep state label "allow access to DHCP server"
            pass in quick on igb2 inet proto udp from any port = bootpc to 192.168.2.1 port = bootps keep state label "allow access to DHCP server"
            pass out quick on igb2 inet proto udp from 192.168.2.1 port = bootps to any port = bootpc keep state label "allow access to DHCP server"
            block drop in log on ! igb3 inet from 192.168.3.0/24 to any
            block drop in log inet from 192.168.3.1 to any
            block drop in log on igb3 inet6 from fe80::208:a2ff:fe0a:ba2f to any
            pass in quick on igb3 inet proto udp from any port = bootpc to 255.255.255.255 port = bootps keep state label "allow access to DHCP server"
            pass in quick on igb3 inet proto udp from any port = bootpc to 192.168.3.1 port = bootps keep state label "allow access to DHCP server"
            pass out quick on igb3 inet proto udp from 192.168.3.1 port = bootps to any port = bootpc keep state label "allow access to DHCP server"
            block drop in log on ! igb4 inet from 192.168.4.0/24 to any
            block drop in log inet from 192.168.4.1 to any
            block drop in log on igb4 inet6 from fe80::208:a2ff:fe0a:ba30 to any
            pass in quick on igb4 inet proto udp from any port = bootpc to 255.255.255.255 port = bootps keep state label "allow access to DHCP server"
            pass in quick on igb4 inet proto udp from any port = bootpc to 192.168.4.1 port = bootps keep state label "allow access to DHCP server"
            pass out quick on igb4 inet proto udp from 192.168.4.1 port = bootps to any port = bootpc keep state label "allow access to DHCP server"
            pass in on lo0 inet all flags S/SA keep state label "pass IPv4 loopback"
            pass out on lo0 inet all flags S/SA keep state label "pass IPv4 loopback"
            pass in on lo0 inet6 all flags S/SA keep state label "pass IPv6 loopback"
            pass out on lo0 inet6 all flags S/SA keep state label "pass IPv6 loopback"
            pass out inet all flags S/SA keep state allow-opts label "let out anything IPv4 from firewall host itself"
            pass out inet6 all flags S/SA keep state allow-opts label "let out anything IPv6 from firewall host itself"
            pass out route-to (igb1 86.23.0.1) inet from 86.23.57.232 to ! 86.23.0.0/18 flags S/SA keep state allow-opts label "let out anything from firewall host itself"
            pass in quick on igb0 proto tcp from any to (igb0) port = https flags S/SA keep state label "anti-lockout rule"
            pass in quick on igb0 proto tcp from any to (igb0) port = http flags S/SA keep state label "anti-lockout rule"
            anchor "userrules/
            " all
            pass in quick on igb1 reply-to (igb1 86.23.0.1) inet proto tcp all flags S/SA keep state label "USER_RULE"
            pass in quick on igb0 inet from 192.168.1.0/24 to any flags S/SA keep state label "USER_RULE: Default allow LAN to any rule"
            pass in quick on igb2 inet from 192.168.2.0/24 to any flags S/SA keep state label "USER_RULE"
            pass in quick on igb3 inet from 192.168.3.0/24 to any flags S/SA keep state label "USER_RULE"
            pass in quick on igb3 inet proto tcp all flags S/SA keep state label "USER_RULE: Allow Traffic to Admin LAN"
            pass in quick on igb4 inet from 192.168.4.0/24 to any flags S/SA keep state label "USER_RULE"
            anchor "tftp-proxy/*" all
            Execute Shell Command

            pfctl -sr</bogonsv6></bogons></virusprot></webconfiguratorlockout></sshlockout></snort2c></snort2c>

            the colours in the diagram are self-explanatory LAN goes off to my office LAN, which is just a simple switch which cannot be configured.  I have set up tagged vlans on the GS switches.  Working out vlan tagging from the Netgear support documents was a headache, but I worked it out in the end.

            pfsense.jpg
            pfsense.jpg_thumb

            1 Reply Last reply Reply Quote 0
            • johnpozJ Online
              johnpoz LAYER 8 Global Moderator
              last edited by

              Screenshot of your firewall rules was what I was talking about ;)

              Your directly connecting your ports to different interfaces in pfsense - why are you tagging them on pfsense?  Pfsense doesn't care or need to see these tags..  While yes you need to tag them on your uplink between switches.  From your drawing putting tags on your pfsense opt interfaces is not needed, and yeah could be causing you some issues.  Pfsense only cares about the tag when when there is going to be more than one vlan on a interface.  If not there is no point to tagging.

              But from these rules
              pass in quick on igb2 inet from 192.168.2.0/24 to any flags S/SA keep state label "USER_RULE"
              pass in quick on igb3 inet from 192.168.3.0/24 to any flags S/SA keep state label "USER_RULE"

              Your doing Any Any.. So yeah you would be able to share files or print.  And to be honest with such rules other than creating new broadcast domains.  Your not firewalling anything..  Might was have everything on same network..  Guessing this is just making sure everything is working before you lock it down mode?

              If your having issues with sharing files.. You running the local firewall on windows, its going to block someone coming from a different network out of the box.  You would have to allow for your other segment on the windows firewall for sharing.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

              1 Reply Last reply Reply Quote 0
              • C Offline
                c4bcons
                last edited by

                @johnpoz:

                Screenshot of your firewall rules was what I was talking about ;)

                Your directly connecting your ports to different interfaces in pfsense - why are you tagging them on pfsense?

                wasn't sure about whether you wanted a screenshot or the complete set - it took seconds for the set :)
                again … I wasn't sure whether or not the pfsense had to tag the traffic, so I did it anyway :)  I'll take it away.
                what I'd really like to do is keep traffic on each vlan separate, with the exception of access to the samba server, and a couple of lan connected printers.  The samba server is a Linux box with Samba running.
                I don't understand the two "pass in quick ...."

                1 Reply Last reply Reply Quote 0
                • C Offline
                  c4bcons
                  last edited by

                  I've removed the tagging from the configuration and rebooted.  The wireless LAN and the home lans seem to be working fine.  I can VPN to work over the wireless LAN.  But I can still ping from 192.168.4.x to 192.168.2.x, which I don't want to do.  And I still can't see the samba share but I can see the printers on the 192.168.1.x network.  There may be something awry with my Samba setup, so I'll check that.

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ Online
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    You can still ping because you have ANY ANY rules!!!  Yeah your going to be able to do anything you want.. Your just routing really not firewalling with an any any rule..

                    You can not see your shares??  So your trying to like browse to them??  Via like your network neighborhood or something?  That is not going to work across segments.  Just access the box directly via its name or IP, ie \computername.domain.tld or \IPADDRESS

                    Post up your rules via a screenshot.. If you wan to be able to access your smb shares, then your going to need to allow tcp 445 if you don't want to be able to ping, then don't allow icmp, or block it before you allow any, etc.

                    Rules are evaluated top down, first rule to trigger wins and the rest of the rules are not looked at.  As the traffic enters interface on pfsense..  So if you don't want vlan X to talk to vlan Y on icmp..  Then on vlan X you would create rules that block icmp, or don't allow it..

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      c4bcons
                      last edited by

                      Thank you johnpoz - it's like learning a new foreign language!  I will look at this later today and report back.

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ Online
                        johnpoz LAYER 8 Global Moderator
                        last edited by

                        heheeh - yeah sure it can seem like that..

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          c4bcons
                          last edited by

                          OK, so I've checked samba on the same vlan as the server and it worked first time, so something's being blocked (I guess).  If I want access samba from my wireless LAN, for instance, How do I enable tcp 445?  .. current rules are below.  The samba server is on the LAN

                          ![WAN rules.png](/public/imported_attachments/1/WAN rules.png)
                          ![WAN rules.png_thumb](/public/imported_attachments/1/WAN rules.png_thumb)
                          ![LAN rules.png](/public/imported_attachments/1/LAN rules.png)
                          ![LAN rules.png_thumb](/public/imported_attachments/1/LAN rules.png_thumb)
                          ![Wireless Rules.png](/public/imported_attachments/1/Wireless Rules.png)
                          ![Wireless Rules.png_thumb](/public/imported_attachments/1/Wireless Rules.png_thumb)
                          ![homelan rules.png](/public/imported_attachments/1/homelan rules.png)
                          ![homelan rules.png_thumb](/public/imported_attachments/1/homelan rules.png_thumb)

                          1 Reply Last reply Reply Quote 0
                          • C Offline
                            c4bcons
                            last edited by

                            Hi sorry to bump this message. Can anyone tell me how to enable tcp on port 445?  I have tried to work it out but I'm really not quite sure where it's done.  Thank you

                            1 Reply Last reply Reply Quote 0
                            • johnpozJ Online
                              johnpoz LAYER 8 Global Moderator
                              last edited by

                              You have an ANY ANY rule - so yeah tcp 445 is open..  If you can not access the shares, then look to firewall running on where the shares are..  Out of the box windows firewall is not going to allow access to its shares from IPs other than its on local network.

                              An intelligent man is sometimes forced to be drunk to spend time with his fools
                              If you get confused: Listen to the Music Play
                              Please don't Chat/PM me for help, unless mod related
                              SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                              1 Reply Last reply Reply Quote 0
                              • C Offline
                                c4bcons
                                last edited by

                                Hm, thank you for the post.  I'm running Linux so there isn't a firewall running.
                                And I can ping the server no problem.

                                1 Reply Last reply Reply Quote 0
                                • johnpozJ Online
                                  johnpoz LAYER 8 Global Moderator
                                  last edited by

                                  Linux has firewalls ;)  So you meant to say your not running one ;)

                                  So your accessing it how \IPaddress of the samba server?  Or \hostname and its not resolving?

                                  Your not going to be able to resolve a hostname via broadcast across segments.  So like I said before your going to have to use fqdn or ipaddress.

                                  What does your samba.conf look like.. Do you have this other network in your hosts allow statement?  If not then no you wouldn't be able to access it.

                                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                                  If you get confused: Listen to the Music Play
                                  Please don't Chat/PM me for help, unless mod related
                                  SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                                  1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    c4bcons
                                    last edited by

                                    OK, I'll check everything tomorrow.  Thank you.  Yes, I know Linux has firewalls …. but unlike windoze it doesn't install one without you asking for it.  :)

                                    1 Reply Last reply Reply Quote 0
                                    • johnpozJ Online
                                      johnpoz LAYER 8 Global Moderator
                                      last edited by

                                      Well that would depend on the distro ;)  But I hear ya…

                                      My guess would be your host allow, if that has your network in.  Then do a simple sniff on pfsense.  Do you see your traffic going to your samba host, do you see a reply?  This can even show if you get an answer to why your denied access, etc.

                                      Do packet capture on your lan interface.. Use the IP address of your samba box as filter.. Then try and connect from your wifi network.. Do you see traffic?  Do you see syn,ack back?  Load it up in wireshark and see what is going on.  If you don't see traffic going there, then sniff on your wifi interface do you see the client sending the traffic.

                                      If you see the syn but not the syn,ack back when sniffing on the lan.. Then its your samba box or your sending to the wrong mac, etc..

                                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                                      If you get confused: Listen to the Music Play
                                      Please don't Chat/PM me for help, unless mod related
                                      SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        c4bcons
                                        last edited by

                                        It's been a while, I know.  Yes, I can connect directly by IP address but I can't see the Samba share.  I'll come back with some more thoughts about my requirements in a few days ..

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