OPNSense Firewall Rules Explained

Поделиться
HTML-код
  • Опубликовано: 26 июн 2024
  • 00:00 - Intro
    00:31 - Resources used in this video
    01:28 - Rule action types
    02:25 - Add private IP ranges alias
    03:26 - LAN rules management
    13:02 - Quick firewall "tick-box"
    15:35 - Rules direction
    16:35 - Rule cloning
    18:00 - WAN rules management
    20:27 - Additional tips
    22:48 - Outro
    PayPal Donation to support the release of new videos:
    www.paypal.com/cgi-bin/webscr...
    View and support us at LBRY:
    lbry.tv/@gatewayittutorials
  • НаукаНаука

Комментарии • 92

  • @HannesDi
    @HannesDi 3 года назад +54

    99% percent of the videos out there claim to get you started with OPNsense, but what I saw there was just bullshit about downloading and installing, sometimes then they showed the interface but stop at the relevant parts.... "How to use the firewall". This is where your video is gold because it finally explains useful things!
    Thanks for this short but great explanatory video

  • @TimmyNET
    @TimmyNET 2 года назад +3

    I forget about your channel. You can go watch someone else with a 5 minute video but you will spend 3 hrs filling the gaps left out. Your video instructions are clear and direct. Thank you.

  • @weazel1024
    @weazel1024 Год назад +6

    Hands down the best video concerning opnsense rules if found until now. Thank you very much.

  • @rent2ownnz
    @rent2ownnz 2 года назад +11

    This is by far the best working run through on how the interfaces relate to one another and I learnt some great tricks with moving the rules around as well. Great stuff. I was almost there but since you easily explained how the data is matched to a a top down approach, it makes logical sense and I imagine it as if there was water pouring in from the tip rule and the different filters the data out like different water filters take out the different minerals ... and then you are left with the pure water (DATA) that can freely flow into the system.
    This really helped me diagnose and also get both my NORD VPN rules ordered correctly and my Wire guard up and running as well.... Just understanding that the Lan Interface has the highest hierarchy in the system just below the WAN interface.... lets me look at the LAN interface rules first, then replicated them into each Vlan Subnet that I had created for IoS, Guest, MainLan and VPN Test Vlan. I had all of the RFC1918 Blocking sorted, but now have a solid understanding on where it needs to be in the rule list. Thank you so much for taking the time to explain this in an easy to understand and almost working lab style! FANTASTIC JOB!

  • @FunctionGermany
    @FunctionGermany 3 месяца назад +3

    I suggest merging the first "allow internet" and the second "block private ranges" rules together for simplicity.
    Instead of the two, you can make one "pass" rule where you choose "private ranges" as the destination and then INVERT the match.
    This way, the single pass rule allows traffic to all destinations except the private ranges - in other words only the internet.
    As a rule of thumb, avoid drop/reject rules when you can simply make stricter pass rules on top of the default "drop everything" rule.

  • @Syrma79
    @Syrma79 9 месяцев назад +1

    I rarely, if ever comment or like a video, but this is one of the best I have seen, and I'm only half way through. Really easy to understand, explained well, and more importantly, shown what the changes do. As others have said, other videos make assumptions on knowledge levels. Great work

  • @cohan88
    @cohan88 Месяц назад

    Saved this beginner hours. Thanks for this simple run-through, just brilliant.

  • @citizenatlrge
    @citizenatlrge Год назад +1

    The algorithm has done good work tonight! This is exactly what I was thinking of trying to search. No really, I hadn't even searched for this particular info yet, I'm still messing with unrelated things in OPN like monitoring and geoip, but here this is, right on time. Sometimes the algo scares me, but then things like this happen and I'm glad it works sometimes.

  • @klausagnoletti1027
    @klausagnoletti1027 3 года назад +1

    Great video. Been opnsense user for 5 yrs. But the penny finally dropped on a few of the firewall things after seeing your video. Thanks!

  • @jrm523
    @jrm523 2 года назад +1

    Great overview. Thanks for taking the time to create this.

  • @Serenuss
    @Serenuss 3 месяца назад

    This is brilliant, thank you for this. Best opnsense video I've seen so far on firewall rules.

  • @neezy666
    @neezy666 2 года назад

    thanks for showing all the actually needed information - really helpful!

  • @PatrickBrodala
    @PatrickBrodala 3 года назад +1

    Quite good introduction to OPN! Thank you!

  • @RFGSwiss
    @RFGSwiss 2 года назад

    this is the only useful opnsense video i found. you picked exactly the right usecases. thanks alot!

  • @NotACrookNixon
    @NotACrookNixon Год назад +1

    Excellent video - very clear demonstration and explanation.

  • @zinkzxd2891
    @zinkzxd2891 Год назад

    Thank you!! This is what I was looking for!

  • @fabianaprilliano9152
    @fabianaprilliano9152 Год назад

    This tutorial is heaven, thank you for the tutorial.

  • @MarcoSerralheiro
    @MarcoSerralheiro Год назад

    I was going nuts because LAN didn't have access to the Internet no matter what I tried. Had no clue that "pfctl -d" would do much more than just enable remote access to the OPNsense interface.
    Thanks a lot!

  • @giovaninavarro
    @giovaninavarro Год назад +1

    Thanks allot. You explain the rules very easily to me.

  • @mate_starbuck
    @mate_starbuck 6 месяцев назад

    You are a very good teacher, thanks for the upload!!!

  • @MrBaltoaca
    @MrBaltoaca 2 года назад

    Thanks for a very useful video!

  • @greengo123jf
    @greengo123jf Год назад +1

    Thanks so much for your very well explained tutorial. ❤

  • @rick5056
    @rick5056 3 года назад +1

    Very good informative video about opnsense.

  • @vmerinom
    @vmerinom 7 месяцев назад

    Great video, thank you! Regards from Chile.

  • @normankraft3306
    @normankraft3306 2 года назад +1

    Cool Video. Thx for the Tutorial.

  • @BartTech
    @BartTech 2 года назад +2

    Supurb video, thanks!

  • @DhruvinShah03
    @DhruvinShah03 3 года назад +1

    Thanks for the video, I had GeoIP blocking going on and also had port forward as well. Still I was seeing some unwanted activity on the machine where I have port forwarded. Then I realized that I need a proper rule sequence.

  • @fu1r4
    @fu1r4 8 месяцев назад

    19:00 I opened a WAN rule to allow remote connection to OPNsense GUI and i did it in the "Firewall: Rules: WAN" and it is working perfect.

  • @McMarius11
    @McMarius11 3 года назад +1

    great video!!!

  • @ZephenHD
    @ZephenHD Месяц назад

    Great video

  • @user-tz3ot6mb2j
    @user-tz3ot6mb2j 3 месяца назад

    very well huge help thanks a lot !

  • @merlingt1
    @merlingt1 2 года назад +1

    Thank you!

  • @user-fd6rb6dl4v
    @user-fd6rb6dl4v Месяц назад

    thanks

  • @b4ux1t3-tech
    @b4ux1t3-tech Год назад +1

    "I can't think of any reason you'd need WAN rules" in the case that you're not using opnsense as an edge firewall, but rather as an internal firewall. ;)

  • @adomasbazinys2352
    @adomasbazinys2352 2 года назад +1

    Maybe you can provide instructions on how to set up an example network like yours in this video?:)

  • @mikeoreilly4020
    @mikeoreilly4020 3 года назад +2

    Thank you. Yet another very clear explanation of foundational firewall rules. I'm using pfSense. One question I have is are you trying to isolate all the local networks, including LAN2, by blocking RFC_1918 addresses in LAN1 instead of blocking them in IOT and GUEST?

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад +1

      I usually isolate any network, including management, LAN, etc, and then allow access to other networks on "only if necessary" basis :)

    • @mikeoreilly4020
      @mikeoreilly4020 3 года назад +1

      @@GatewayITTutorials Got it, thanks.

  • @DanielGonzalez-hc4hb
    @DanielGonzalez-hc4hb 2 года назад

    Thanks! (y)

  • @unapologetic7900
    @unapologetic7900 2 года назад

    Question.... If all my "LAN" interfaces are members of a "Bridge", do I only need these "LAN" Rules applied to the Bridge Interface, not to each LAN Port individually?

  • @Kilzu1
    @Kilzu1 3 года назад +1

    Nice guide. Just a tip for being more organized. In rules creation, category is used to give a name for category that is used to add category filter to firewall rules window.
    If you don't care about category but still want to log rule entries, then you can just give description and it will be shown on logs etc as description.
    If you don't type description, then default description "default allow rule" is used instead.
    Category can be left empty because it's just a filter.

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад +1

      Now that I am thinking about it, I may have left an impression, that category is imperative to fill in :D
      But you are right, it isn't, it's just "a nice to have".

  • @sairfan06
    @sairfan06 2 года назад

    I want to schedule particular web site access, can i do it with OpnSense or please advise if need a different firewall, thanks

  • @rockbaoboa9346
    @rockbaoboa9346 Год назад

    hello! congratulations for the video. I would like to know how to generate a proxy and firewall report in Opnsense? Type, Sarg or Lightsquid

  • @DalyGutierrez
    @DalyGutierrez 2 года назад

    Thanks for the video! Quick question about the "Reject Private Ranges" rule... It's clear that this blocks pinging/access to private IP addresses on OTHER LANs, but it does NOT block pinging/access to another device on the SAME LAN. Is that expected? Thanks!

    • @Chase07450
      @Chase07450 Год назад

      this is a good question. Seems to me it WILL block traffic on the same lan, if you don't provide a source ip range.

  • @alvarorodelo6761
    @alvarorodelo6761 2 года назад

    how can i add rules to only allow remote desktop (port 3389) from the outside to my lan, but only certain external ips or mac-addresses?

  • @almighty2374
    @almighty2374 3 года назад +5

    Hy I really recommended a video for dns ad blocking pls load up one!

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад

      It's up on the schedule, would be either AdGuard Home vs PiHole, or AdGuard home with OPNSense.
      Let me know what you think is best :)

    • @Jdjfjfigkgigjfjfjej
      @Jdjfjfigkgigjfjfjej 3 года назад

      @@GatewayITTutorials I'd be interested in an OPNsense plugin such as AdGuard. I would love to eliminate my PiHole from my network

  • @NhatLinhNguyen-ru5lf
    @NhatLinhNguyen-ru5lf Месяц назад

    Would blocking Private IPs block my access to OPNsense firewall itself if it is only accessable on my LAN1?

  • @scottjmagee
    @scottjmagee 3 года назад +1

    Great Video thank you. You mention always using Floating Rules instead of WAN rules as WAN rules are ignored, but this is not my experience, is this something that has been fixed now?

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад

      It might have been, in a recent release. But because I got used to Floating rules, I can't change my ways now)

  • @64242359
    @64242359 Год назад

    Help! how do I delete/disable floating rules or default rules?
    [edit] manage to remove the floating in config.xml, still no idea how to delete the default rules.

  • @Glatze603
    @Glatze603 Год назад +1

    Your first rule (allow internet) is not, what it looks like! Better would be Wan, tcp and http/https only! Your rule allows traffic to the other Lan too. When you create rules, they should be named exactly what they are for.

    • @GatewayITTutorials
      @GatewayITTutorials  Год назад +1

      TCP/HTTP is way too strict for a home setup, but naming it "Allow All" may be a better idea indeed. I was just used to the name WAN on my setups. Thanks for you suggestion.

  • @BrianThomas
    @BrianThomas 2 года назад +1

    I noticed on the floating rule only TCP traffic for HTTP and HTTPS was chosen. Wouldn't this be TCP/UDP instead of just TCP?

  • @irfancpv3454
    @irfancpv3454 4 месяца назад

    how did you connect both debian with firewall.

  • @jproveta
    @jproveta 2 года назад +1

    Hi, I'm trying to switch from pfSense to OPNsense, but every time I add a rule on the Firewall the order of the rules changes, everything is out of the order I previously put and recorded, any tips? Thanks

    • @GatewayITTutorials
      @GatewayITTutorials  2 года назад +1

      Hey, might be a bug in the version you are running.
      Would you mind sharing a short screencap of this issue in our Reddit community? It will be very interesting to look at.

    • @jproveta
      @jproveta 2 года назад

      @@GatewayITTutorials OK, thanks

  • @aullusp
    @aullusp 3 года назад +1

    Boa tarde, estou dificuldade de redirecionar a porta 80 para 9081. Meu servidor está na rede interna 10.0.0.131:80 e na porta externa 9081. Não consigo fazer esses direcionamento, poderia me ajudar ? Troquei a porta padrão de acesso ao console para porta 8086 e mesmo assim nao aceita regra.

    • @GatewayITTutorials
      @GatewayITTutorials  2 года назад +1

      You'll have to repeat that in English my dude, I know a couple of languages, but not that many)

  • @jesuschavezbastias9739
    @jesuschavezbastias9739 2 года назад

    My dear friend, I have learned a lot with your videos. Is possible that you make a video to configuring Postfix email Gateway and RSPAMD please into OpnSense?. 1.000 thanks!

    • @GatewayITTutorials
      @GatewayITTutorials  2 года назад

      That's a very specific usecase, but I'll think about it.

  • @macster1457
    @macster1457 2 года назад

    I have SafeSearch enforced on my network through my router, but it's easily bypassed using Firefox Doh. Can this firewall block users from bypassing router rules using Doh?

    • @GatewayITTutorials
      @GatewayITTutorials  2 года назад

      There is no point and click solution that will do this for you.
      DOH is a DNS over HTTPs, so unless you have some serious DPI skills, you won't be able to block it on the protocol level.
      On the other hand you could block some of the DOH providers, like:
      1.1.1.1, 9.9.9.9 and so on with a firewall rule. Not an elegant solution, but should work in most cases.

  • @alexgratia9028
    @alexgratia9028 3 года назад +1

    How did you come up with the IP address for the content? You did not explain How? or Why we need to have those IP addresses in there?

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад

      What IP addresses are you concerned about? I tried to make this video as IP-addressless (if it's even a word, lol) as possible.
      EDIT:
      Wait, do you mean why I added the Alias for private IP ranges? It is to block network access to any internal network you can think of (192.168.0.0/24 is not the only private IP range in the world of IT).
      Here is a Wiki page to extend your knowledge on this:
      en.wikipedia.org/wiki/Private_network

    • @alexgratia9028
      @alexgratia9028 3 года назад +4

      @@GatewayITTutorialsThank You for your reply........... I would not think that 192.168.0.0/24 is the only IP range in the world. what I am trying to get at is this. I am trying to follow your video to set up my Opnsensen on the firewall. You are not explaining in detail how you came up with the content IP addresses. It appears that you are looking at some secondary notes and typing them into the content field.
      Why do I need an IP address in the content field? How do I, the viewer of your video that has never done this before know what IP address I need to put in? You are not explaining what these sections are.
      I am by far not trying to say that I am not grateful for your videos, but looking at this video left me in the dark. I do get the (Name Field, Aliases are named lists of networks, hosts or ports that can be used as one entity by selecting the alias name in the various supported sections of the firewall. These aliases are particularly useful to condense firewall rules and minimize changes).
      And also I do get (Types Networks, are Networks are specified in Classless(If that is a word) Inter-Domain Routing format (CIDR). Use the correct CIDR mask for each entry. For instance, a /32 specifies a single IPv4 host, or /128 specifies a single IPv6 host, whereas /24 specifies 255.255.255.0 and /64 specifies a normal IPv6 network. Network type Aliases can contain exclusion hosts or networks. Exclusion addresses starts with “!” sign (eg !192.168.0.0/24) and can be used to exclude hosts or networks from current Alias or Network Group Alias.
      Even the Opnsense document website does not touch on the content section (docs.opnsense.org/manual/aliases.html). I was just hoping you would be able to explain that part. It could also be that I am over thinking that part of the instructions of your video. Thanks

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад +1

      You are a bit overthinking :)
      As I said in my previous comment, this alias will allow you to block ANY unauthorised access to ANY internal network that may possibly exist (now or in the future).
      To allow access to the networks you need access to, add "Pass" rule and specify a network or alias just above "Reject PrivateRanges" rule.
      So you could just "blindly" copy the contents of an alias I showed in the video and it will work, I promise)

    • @alexgratia9028
      @alexgratia9028 3 года назад +1

      @@GatewayITTutorials Thank You......Just to let you I have subscribed when I saw this video. You are the only one with this video explaining how to configure your Opnsense firewall.

  • @CSBABAA
    @CSBABAA 3 года назад

    How can we enable Postfix? i have check in plugin postfix plugin not appearing what to do?

  • @aoczon
    @aoczon 2 года назад

    Can you also do a tutorial for multi wan load balancing and failover thanks

    • @GatewayITTutorials
      @GatewayITTutorials  2 года назад +1

      Thanks for the suggestion. I'll add it to my videos-to-do list :)

    • @aoczon
      @aoczon 2 года назад

      @@GatewayITTutorials i think the latest ver has some issues with multi wan.

  • @ManojKumar-pt4mx
    @ManojKumar-pt4mx 3 года назад

    is possible that on not

  • @m.m.m.c.a.k.e
    @m.m.m.c.a.k.e Год назад +1

    Hey! Thank you for your hard work, friend. Top 3, open source firewalls, minimum 1 gigabit throughput, best configurability with ease of use?
    - Also top 3 hardware box which either “flashable” and or dual nic capable low power PC’s? Thank you, kindly. 😊

    • @GatewayITTutorials
      @GatewayITTutorials  Год назад +1

      Top 3 OSS firewalls (as a bundle, order doesn't matter):
      - VyOS
      - pfSense/OPNSense
      - OpenWRT
      For the hardware to install them on, have a look at some of the STH videos/posts, like this one:
      www.servethehome.com/inexpensive-4x-2-5gbe-fanless-router-firewall-box-review-intel-j4125-i225-pfsense/

  • @ManojKumar-pt4mx
    @ManojKumar-pt4mx 3 года назад +1

    Hi how we can block the Mime Types in OPNsense firewall ?

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад

      Hey. OPNSense doesn't check the traffic headers by default, it's not what it was designed to do, and to be honest I hate firewall appliances that do that as a default that you can't turn off, it leads to a lot of problems down the road.
      But there is a way to enable such functionality on OPNSense through a security package Sensei: it has a free version and a paid version.
      Install it, scroll through options, and test it out for yourself. It can block certain mime types, adult websites, malware websites and so on.

  • @FHMchaxz
    @FHMchaxz 8 месяцев назад

    Hi do you have tutorial on how to block facebook app in phone using OPNsense? Thank you

  • @casperbjrnchristiansen629
    @casperbjrnchristiansen629 2 года назад +2

    OPNsense vs Pfsense?

  • @CJRunnalls
    @CJRunnalls 3 года назад +3

    Please do a video on OPNsense firewalls for example two Xbox one's on the same network playing the same game. I followed Spaceinvader One's pfsense video ( ruclips.net/video/whGPRC9rQYw/видео.html ) but I have OPNsense and still have problems playing the same game on different PCs on the same network, where one will connect and the other gets an error. I believe the error is something to do with port 3074.
    It's just the last bit of Spaceinvader Ones video where he selects PureNAT and OPNsense either doesn't seem to support it or I can't find it. Please help 🙏

    • @GatewayITTutorials
      @GatewayITTutorials  3 года назад +2

      Hey there, this seems like a NAT issue.
      Please post it in our subreddit, I'll pick it up from there, because I can't make a video on this due to a fact that I don't own gaming console.

  • @benjamintrench8722
    @benjamintrench8722 9 месяцев назад

    Pay is not our Pal. They're a Rip Off !!!

  • @dariooteroherves8461
    @dariooteroherves8461 2 года назад

    no vaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa