Isolating Networks in OPNsense

Sdílet
Vložit
  • čas přidán 26. 08. 2024

Komentáře • 117

  • @starfoxBR77
    @starfoxBR77 Před rokem +14

    Thank you for continuing making these videos. You will soon be the best OPNSense / Home Network source in the world!

    • @homenetworkguy
      @homenetworkguy  Před rokem +4

      Thanks so much for supporting me as well as the kind words! I appreciate it!

  • @panosangel2883
    @panosangel2883 Před 8 měsíci +3

    Another great video with clear explanations. Watch it people until the very end ;)

    • @homenetworkguy
      @homenetworkguy  Před 8 měsíci +2

      Thanks! Haha. I thought I would show some bloopers where I had to troubleshoot while filming. Even though I’ve worked with OPNsense for a while, I still mess up!

    • @panosangel2883
      @panosangel2883 Před 8 měsíci +1

      @@homenetworkguy this is happening to me more than I'd expect as well.

  • @alexisbeaulieu9207
    @alexisbeaulieu9207 Před rokem +5

    Awesome video! I think a good follow up video would be on plugins like mDNS Repeater and/or UDP Broadcast Relay to enable devices like smartphones to cast audio/video on IoT devices

    • @homenetworkguy
      @homenetworkguy  Před rokem +3

      Thanks! I have another firewall rule video coming up which I think will be helpful as well. I use MDNS on my network mostly to share my printer across networks so it can be discoverable. The plugin configuration is pretty simple but it has to be combined with firewall rules so there could be some usefulness of such a video.
      I have noticed that the MDNS plugin in OPNsense doesn't work for all types of multicast traffic (perhaps it is hardcoded to only repeat certain multicast addresses and not others). Ideally I try to keep traffic which needs to communicate with protocols such as Bonjour/Ahavi on the same network to keep things simple. Fortunately most of those devices are IOT (or close enough to be IOT) devices so I don't mind them being on the same network anyway.
      Ultimately, even though I want increased security on my network and do have some things locked down tighter, I also need my network to "just work". haha. If my network is so locked down that it's not usable, my end users (aka my family) will not be happy. I also don't want to spend too much time troubleshooting things when I could be doing other more constructive things like create content on CZcams!

  • @MrPir84free
    @MrPir84free Před 2 měsíci +1

    Allowing ping to just the gateway IP of the subnet that your machine is on is a good idea to allow you to verify that your device is indeed connected. If a machine is assigned an IP, the gateway has to be assigned anyways, so allowing ping to that IP is not giving away any information that is not already given. Highly useful if you are on wi-fi.
    Allowing ping to other devices on the same network, or to other gateway IP's, or to other gateway devices is a choice that one would need to make... As it's possible to enable and disable rules quite easily, it's possible to create the allowed rule, and then enable those rules depending upon whether you are troubleshooting at the moment or not.

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci

      Yeah not a bad idea to allow it for the gateway IP at a minimum.

  • @jjmart5127
    @jjmart5127 Před rokem +6

    Man, relevant stuff. Thanks, DC!

    • @homenetworkguy
      @homenetworkguy  Před rokem +2

      Thanks! I have another firewall rule one coming up soon. Going to discuss floating rules, firewall group rules, and interface rules and when you may want to use each type (especially the first 2 types because there are subtle differences).

    • @jjmart5127
      @jjmart5127 Před rokem +1

      @@homenetworkguy if I could make a suggestion, maybe use the cicada theme? It's a dark theme and faster than the rebellion theme. Besides my retinas will thank you. 😎

    • @homenetworkguy
      @homenetworkguy  Před rokem

      Someone else mentioned that the dark theme gets more views so I think I'm going to have to switch to the dark side since dark mode is more preferred these days. I already started another video that's not in dark mode but I can change after that one.

    • @JasonsLabVideos
      @JasonsLabVideos Před rokem

      He's nailing this stuff rock solid !

  • @gambler3k
    @gambler3k Před měsícem

    tysm, finally got my first vlan rules to work. had problem acessing internet but this video helped me alot to understand.

    • @homenetworkguy
      @homenetworkguy  Před měsícem

      Glad the video helped you understand the firewall rules!

  • @jameshendry3571
    @jameshendry3571 Před 4 měsíci

    Really great video - thanks have used this to start segregating my network. I followed this video to the letter and if you apply the "Destination Invert / Private Networks onto your outband LAN rule then you prevent the LAN traffic from being able to see the guest traffic in both directions

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      Thanks! Glad you found it helpful. I’m not sure what you mean about applying the rule outbound on the LAN interface. Using the direction of “in” is sufficient because any traffic entering into the LAN interface can be blocked with “in” rules. If you block access to other networks with “in” direction rules (which is the default), you won’t have access to any of the traffic on other networks. Using the direction of “out” for rules is less efficient and should only be used in a few cases (such as blocking outbound WAN traffic). Not sure if you were referring to the direction of the rules but thought I would mention it.

    • @jameshendry3571
      @jameshendry3571 Před 4 měsíci

      @@homenetworkguy the default allow all rule on your LAN interface (which I called outbound) still allows you to send traffic from LAN to Guest. I applied your Destination Invert / Private Networks logic to this default rule to ensure both the LAN and guest a segmented. IE you can ping portscan from LAN to guest

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      Ohh I quickly glanced at my video. You’re saying I changed the GUEST network rules but not the LAN network rules so it has access to all local networks since it has an allow all rule? I was focused on just isolating a single network probably so I could demonstrate the different ways you can implement the rules. I definitely mess up in my videos. Haha. Unlike written content, I can’t go back and fix it without making another video.

  • @prutser67
    @prutser67 Před 29 dny

    Very clear and practical example.

  • @brahyamalmonteruiz9984
    @brahyamalmonteruiz9984 Před 4 měsíci +1

    Great video

  • @CustomRideOns
    @CustomRideOns Před 3 měsíci

    You are a life saver! Thank you so much for this excellent content.

  • @user-jh4ws7zr8x
    @user-jh4ws7zr8x Před 2 měsíci

    Do these rules need to be applied to the LAN and WAN interface?? Thanks for this video really helped a lot!!

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci

      Only the LAN and other interfaces/VLANs. You do not need to do it for the WAN. Glad the video helped!

  • @parishaymakers
    @parishaymakers Před 11 měsíci +1

    Awesome video brother!

  • @jacko101
    @jacko101 Před 9 měsíci

    Exactly what I was looking for, thanks so much! Subbed👍

    • @homenetworkguy
      @homenetworkguy  Před 9 měsíci

      Thanks! I’m glad you found what you were looking for!

  • @YellowstoneCommie
    @YellowstoneCommie Před 5 měsíci

    Ok i figures out what you meant with the allow all rule

  • @starfoxBR77
    @starfoxBR77 Před rokem +2

    Btw I never understood why sometimes on Source/Destiny fields on rules we go "NET_NAME Net" and sometimes "NET_NAME Addresses".

    • @homenetworkguy
      @homenetworkguy  Před rokem +6

      The “net” aliases refer to the entire network IP address range (such as 192.168.1.1/24) while the “address” aliases only refer to the interface IP address (such as 192.168.1.1).

    • @starfoxBR77
      @starfoxBR77 Před rokem +4

      @@homenetworkguy 👌 Now it makes more sense :-)
      Thank you!

  • @swubutu
    @swubutu Před 2 měsíci

    Thank you !

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci

      You’re welcome! Thanks for the support! I appreciate it!

  • @H0rnetz
    @H0rnetz Před 27 dny

    Hello, this doesn't seem to work for me.
    I got a opnsense running on proxmox mini pc with two ethernet, one for wan one for lan and all my vlan have lan as parent. When I set up those rules, I lose access to the internet.
    Here is my topology:
    FAI edge router -> opnsense wan -> opnsense lan -> L2 switch
    -> VM in vlan tagged, that loose access to the internet.
    My best guest is that it loose internet access because the lan is relaying that, and we juste cut that off. How would you go in scenario like this to seggregate the lan from the vlan without loosing internet access?

    • @homenetworkguy
      @homenetworkguy  Před 27 dny

      Hmm it’s hard to say without looking at the details of your config. I isolate VLANs on my main OPNsense box as well as VMs that are behind my primary OPNsense for testing purposes using the same types of rules to isolate networks without experiencing such issues.

    • @H0rnetz
      @H0rnetz Před 25 dny

      @@homenetworkguy I think I found what the issue was: I'm using a local pi-hole, configured in opnsense, for dns, so it could not be resolved. By setting regular dns to that vlan I do have internet access. 👍👍

    • @homenetworkguy
      @homenetworkguy  Před 25 dny

      Ahh sounds good. Glad you got it sorted out. DNS is one of those things I try to keep simple to minimize issues on my network since it can always cause problems. Haha

  • @freshnews8538
    @freshnews8538 Před 10 měsíci

    Awesome video. Can you please make a video about port forwarding for self hosted app?

    • @homenetworkguy
      @homenetworkguy  Před 10 měsíci

      Yeah I could. There’s not a lot to basic port forwarding but it gets more interesting if you want to use a reverse proxy and put Cloudflare in front of your services to help protect them better. Of course, you would want to lock stuff down as best you can if you’re leaving it open to the world. Most will recommend using a VPN to connect to your home network instead (I do that as well).

  • @swubutu
    @swubutu Před 2 měsíci

    Hi Dustin,
    was wondering if you plann to do a vlan isolated network with the new Kea DHCP? :D

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci +1

      Kea DHCP is on my todo list. haha

    • @swubutu
      @swubutu Před 2 měsíci

      @@homenetworkguy awsome :D

  • @dtitan1993
    @dtitan1993 Před 4 měsíci +1

    Trying to Isolate my networks but its not working. I have Vlan 100 and Vlan 200. I am tryin gto prevent anything on VLAN100 to access anything on VLAN 200. I created a block rule from VLan 100 to VLAN 200 ....under VLAN100 interface (in rule) I followed your video but its not working.

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci +1

      Do you have your block rule above any other allow rules? The order of the rules is important. Make sure you leave the rule at the default direction of “in” even though it sounds like “out” is the appropriate option.

    • @YellowstoneCommie
      @YellowstoneCommie Před 4 měsíci +1

      I am having the same issue. I followed your instructions exactly but can still freely ping between vlans

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      @@YellowstoneCommie I would probably have to see the rules to identify the issue. There are a couple of ways you can go about blocking traffic via firewall rules. Order matters as well as other firewall rule options.

    • @jeffreyooi1971
      @jeffreyooi1971 Před 2 měsíci

      Why do you still need the blocking rule since you already created the VLAN? isn't that is the function of VLAN to separate or so-called isolate out the network? I am confused now...🙂🙂🙂

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci +1

      @@jeffreyooi1971 when you create rules to allow traffic to other VLANs, the router will happily allow traffic between the networks. That is the job of a router. Firewall rules are needed to restrict or allow access between the networks. Soon as you create an ‘allow all traffic’ type of rule you will need to create a block rule to restrict access to other networks while allowing access to the Internet for example. You can achieve this different ways as I show in the video. VLANs operate at Layer 2 while routers are operating at Layer 3.

  • @SteveStowell
    @SteveStowell Před 5 měsíci +1

    Did you isolate each guest

    • @homenetworkguy
      @homenetworkguy  Před 5 měsíci

      This video focuses on isolating networks. To isolate guests/clients within each network, you can use port isolation for wired devices and client isolation for wireless devices. In addition, for desktops/servers you can install a local firewall for further protection. Not all devices have the ability to install your own local firewall so the best you can do is use port isolation or client isolation for wired/wireless devices if you want isolation within each network.

  • @deanspanos8210
    @deanspanos8210 Před rokem

    I drove myself crazy trying to make rules to get my guest network not to talk to my lan and vice versa, but nothing worked except just creating a floating rule saying no data transfer from guest to lan in any direction and another floating rule allowing dns. I don't know if it's because I am only using a pc with one nic and a managed switch.

    • @homenetworkguy
      @homenetworkguy  Před rokem +1

      Perhaps you don’t have all of the VLAN configuration exactly right on OPNsense or the switch since you should be able to isolate networks as I have described whether the networks are VLANs or other networks on physical interfaces.

  • @LedufInfraLeDufiNFrA
    @LedufInfraLeDufiNFrA Před 4 měsíci

    1 - VLAN is your friends ,
    2- But far better : on interface per zone ... Physical isolation .

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      Yeah physical isolation is of course even more secure but the purpose of the video is to show how to isolate VLAN traffic via firewall rules.

  • @jstjohn11
    @jstjohn11 Před rokem

    Really love your videos. Need some help on FW Alias for NAS (SMB). How do you add the port 139, and 445 to an alias? Newbie question, just dont know where to input these port? Trying to write a rule to allow SMB traffic from one interface to another.

    • @homenetworkguy
      @homenetworkguy  Před rokem +1

      I'm glad you enjoy them! You would need to go to Firewall > Aliases. Click the "+" button. Enter a Name. Select Port(s) as the Type. Enter 139 and 445 in the Content. Click Save.
      Go to the source interface in OPNsense where you want a client to access a server on another interface on OPNsense and create a rule which uses the source interface net alias (or specific IPs). Enter the destination IP or network and chose the alias for the destination port and it should include both port numbers.

    • @jstjohn11
      @jstjohn11 Před 11 měsíci

      @@homenetworkguy Thank you! That did the trick. However I did end up having to use the Destination IP of the NAS appliance verses being able to use the interface name. (Example: NAS.address) So I think I may have a DNS issue as well. Using OpenDNS and UnboundDNS within the Opnsense FW. Still learning here. Not sure how or where to register a device name and IP etc.

  • @YellowstoneCommie
    @YellowstoneCommie Před 4 měsíci

    I applied the rules for each of my vlans but i noticed i can still ping from one vlan to another

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      Did you remove or disable the original allow all rule on the LAN interface? (only do that when you have other rules in place so you don’t block access)

    • @YellowstoneCommie
      @YellowstoneCommie Před 4 měsíci

      @homenetworkguy I actually left the last rule even though I combined the allow all with the block access to private lan . I forgot to mention I have a new switch which is a 1930 hpe so it has routing capabilities. Apparently I set it up to use them which is why my devices work but my vlans seems to be communicating between each other. I can ping all vlan interfaces no matter which vlan I am in. The problem is when I disable the routing I can only get the assigned ip in the right vlan and can ping the vlan gateway but I cannot access the internet. Although I can also not ping pretty much anything except the vlan gateway

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      @@YellowstoneCommie ahh if you used the layer 3 routing options of your switch the traffic may not even travel to your firewall since the switch is handling the traffic. If you turn on the L3 routing and you can reach the Internet- assuming the traffic hits the firewall it sounds a bit like your firewall rules are not correct but I would have to see how they are configured. It’s tough to know for sure without knowing how everything is configured such as the fact you were using L3 routing features of the switch.

    • @YellowstoneCommie
      @YellowstoneCommie Před 4 měsíci

      @homenetworkguy ok I think my plan is to first disable all routing on my layer 3 switch and then erase all learned routes and dynamic routing protocols. Then I will create a default route pointing to the firewall gateway. Then I think I can enable routing and all traffic will again be managed by our rules. I noticed when I turned off routing on the L3 switch, I could only communicate within my vlans but nowhere else. I found that odd but I had to table this for testing first

  • @joecook4451
    @joecook4451 Před 4 měsíci

    great video! although still having trouble blocking just 1 lan ip from internet. i have mini pc with opsense and 1 wan port and 1 lan port. then lan port of mini pc to switch. also have old router in bridge mode for wifi, plugged into switch. so im not sure if that has something to do with it.
    basically it ether blocks all lan traffic to internet or none... ive set these rules up in past on pfsense routers and dd-wrt router and never had much trouble. maybe you could shed some light on the subject?

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      If you want to block a single IP, you’ll need to make that device a static IP. The firewall rule should be set as a block rule and use that static IP as the source and destination should be any. The rule needs to be above the rule to allow access to the Internet (near the top of the list of rules). The order matters when creating rules.

    • @joecook4451
      @joecook4451 Před 4 měsíci

      that didnt work. im thinking the switch is routing by mac and bypasses the routers acl.

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      You wouldn't be the first one with that issue if that is the case. I think some others are having trouble because they are doing some L3 routing on their switches with ACLs (although by default, I think most switches would not have such features enabled since the ACL needs to be configured to function as intended, I believe). I always assume that is not the case for most users so I forget to ask if there is any L3 switching going on with the switches being used on your network. If the switch is performing the routing, then OPNsense (and other routers/firewalls) will not see that traffic so it will not be able to have any firewall rules applied.

    • @joecook4451
      @joecook4451 Před 4 měsíci

      i ordered a usb to ethernet, to plug into opnsense and give another lan port. then ill plug the bridged wifi router into it. im hoping i can get mac address control at least on those devices. i have all devices in network staticly asigned dhcp. i know its overkill but i hope it helps in blocking what needs blocked. i eventually got rid of the allow any line. then created alise for 3 groups. wan-no= devices never gets wan. wan-yes= always needs wan. screentime=devices like firetv tablets cellphone. and created allow for those. this worked great. except it allowed devices on the lan to talk to each other, asuuming mac address level routing... so for example if i disable screentime rule. all those devices wont have internet, which is great. although my media center has emby serving the media so those local devices can still acess it.
      once i get usb etherent today, i need to find the proper way to make sure its part of the lan. and make sure it gets dhcp from opnsense like the lan port does. i tinkered with making a bridge before but not sure if its whats needed.
      also thought of doing vlans. not my strong suit btw. but from what i understand it would create another subnet for each vlan group. im not sure if that will work as well. since my suspicion is the switch will still bypass router and use switch to route by mac address..

    • @homenetworkguy
      @homenetworkguy  Před 4 měsíci

      One thing to keep in mind: devices on the same network can talk to each other and do not pass through the firewall. It’s how networks function. If you want restrict access within the same network you will need to install a local firewall on each device (server, PC, etc) but that’s not something you can really do with iPhones, iPads, media players for instance. You would need to put those devices on their own VLAN and restrict access between networks in OPNsense. Each VLAN is essentially its own subnet. You can control access via firewall rules.

  • @JasonsLabVideos
    @JasonsLabVideos Před rokem

    Wicked idea !!

  • @TismoGaming
    @TismoGaming Před 11 měsíci

    Would this guide for rules still apply with pihole as dns server ?

    • @homenetworkguy
      @homenetworkguy  Před 11 měsíci

      Yes. Instead of using the interface address alias for the DNS server, you would use the Pi-hole DNS server address if you are assigning the Pi-hole DNS server to all your clients via DHCP. If you are using Pi-hole upstream with Unbound DNS, the rules can be the same as this guide (because you would be using Unbound for the clients and then Unbound would be using Pi-hole as the upstream DNS server).

    • @homenetworkguy
      @homenetworkguy  Před 10 měsíci

      Sorry for the delay. Your comment got flagged as “held for review” and I don’t check for those very often because they are filtered out by default. The rules should still apply but you would probably need to use the IP address of your Pi-hole server instead of using the interface address depending how you have it set up on your network.
      As for not being able to ping your interfaces, you need to create a rule to allow ICMP on your networks. If you don’t have all protocols allowed with your rules you would have to create a separate rule to allow ICMP. If you want to allow it for your entire network you could create a floating rule so it can apply to all interfaces.

  • @Apollopayne25
    @Apollopayne25 Před rokem

    Can you create an alias for certain single LAN ips ( eg. 2 computers that I don’t want them to have access to my server)

    • @homenetworkguy
      @homenetworkguy  Před rokem

      If your server is on another network and you have the networks isolated from each other, then you wouldn’t need an alias. If you are allowing the entire LAN access to your server on another network then you could create an alias with a block rule to deny access to your server.

    • @Apollopayne25
      @Apollopayne25 Před rokem

      @@homenetworkguy my server is on my same network. Just want to block my son computer to access it

    • @homenetworkguy
      @homenetworkguy  Před rokem +1

      @@Apollopayne25 if it’s on the same network then you will have to enable a firewall on your server and block the PCs on the server’s firewall. The router’s firewall won’t be able to block those PCs if they’re on the same network because networking was designed to allow communication between devices that are in the same network. Since no routing across networks is necessary, you can’t block the traffic via the firewall on your router (OPNsense, for example).

  • @ryshask
    @ryshask Před 2 měsíci

    I'm amazed that in 2024 this stuff is still complete garbage in regard to management... It's no wonder there are so many network issues to this day.

    • @homenetworkguy
      @homenetworkguy  Před 2 měsíci

      Why is it garbage? Separating networks via VLANs/firewall rules is just one additional layer of projection against internal/external threats. You could just protect the edge of your network but if something gets past the edge firewall, practically all of the network security is defeated. The problem is not an easy one to solve completely and the original Internet and networks were not really designed with much security in mind.

  • @YellowstoneCommie
    @YellowstoneCommie Před 5 měsíci

    I cannot ping my firewall even when directly plugged in. I have automatic rules created one which is blocking all my traffic called default / deny state violation rule

    • @homenetworkguy
      @homenetworkguy  Před 5 měsíci

      ICMP protocol needs to be allowed on your network via firewall rules if you want to ping devices on other networks and the firewall interfaces.

    • @YellowstoneCommie
      @YellowstoneCommie Před 5 měsíci

      @@homenetworkguy ok 👍 I went very slowly and practiced everything you said and now I am good

    • @YellowstoneCommie
      @YellowstoneCommie Před 5 měsíci

      Thanks you for the help I feel much safer now that there is some separation of the attack surface

    • @homenetworkguy
      @homenetworkguy  Před 5 měsíci +1

      I’m glad you got it all sorted out!

    • @YellowstoneCommie
      @YellowstoneCommie Před 5 měsíci

      @homenetworkguy do you have suggestions on how to take my old router which is now acting as my ap? I want to have the guest wifi users get one vlan and the home ssid to get another vlan. I have a catalyst switch where the ap is plugged in. Everything is getting assigned the same vlan which is what the switch port is configured for. Do I need to have the port be a trunk port on the switch where the ap is ?