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

    Ipguard package

    Scheduled Pinned Locked Moved pfSense Packages
    57 Posts 20 Posters 37.3k 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.
    • marcellocM
      marcelloc
      last edited by

      First ipguard-dev release done.

      Please, test and feedback.
      Do not forget to create rules allowing access to pfsense's ip address  ;)

      att,
      Marcello Coutinho

      Treinamentos de Elite: http://sys-squad.com

      Help a community developer! ;D

      1 Reply Last reply Reply Quote 0
      • M
        mohandshamada
        last edited by

        @marcelloc:

        First ipguard-dev release done.

        Please, test and feedback.
        Do not forget to create rules allowing access to pfsense's ip address  ;)

        att,
        Marcello Coutinho

        thanks a lot this is what i want but i don't understand what rule should i create for accessing pfsense sorry i'm newbie

        1 Reply Last reply Reply Quote 0
        • marcellocM
          marcelloc
          last edited by

          Mac adresses and ip rules on package gui for your machine /network and pfsense
          I'll try to screenshot a sample config.

          Treinamentos de Elite: http://sys-squad.com

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • M
            mohandshamada
            last edited by

            @marcelloc:

            Mac adresses and ip rules on package gui for your machine /network and pfsense
            I'll try to screenshot a sample config.

            i don't find words to thank you for your fast response and i'm waiting your explanation

            1 Reply Last reply Reply Quote 0
            • marcellocM
              marcelloc
              last edited by

              This is the sample file with comments that came with ipguard:

              00:d0:b7:df:ee:4a       192.168.1.100           Third column is a comment
              00:d0:b7:16:0b:f9       192.168.1.64
              00:d0:b7:16:0b:f9       192.168.1.66            There can be more than one IP
              00:00:21:e9:fe:9a       192.168.2.56
              00:08:c7:eb:22:6c       192.168.2.56            Also more than one MAC
              192.168.16.147          00:04:76:18:a0:b9       Order doesn't matter
              00:00:00:00:00:00       192.168.50.163          Zero MAC == any MAC
              00:0d:61:76:ef:eb       0.0.0.0                 Zero IP == any IP
              00:02:b3:60:50:9c       127.0.0.1               Known wrong IP == MAC blocked
              00:0f:5b:83:30:0a       host.domain.tld         Hostnames resolved
              00:00:00:00:00:00       192.168.4.0/24          Allow subnet
              de:ad:be:ef:12:34       192.168.0.0/16          Block all other subnets

              00:0c:6e:a0:f6:6d       192.168.1.254         Comment

              ipguard.png_thumb
              ipguard.png

              Treinamentos de Elite: http://sys-squad.com

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • M
                mohandshamada
                last edited by

                today i'm so happy realy thank you " maro "

                1 Reply Last reply Reply Quote 0
                • M
                  mohandshamada
                  last edited by

                  can you make any thing made the user who connect first is a live and connected and the second who isn't allowed and change his mac address to live one to be disconnected i need that cause when i disable some users the change their mac address to a live one

                  1 Reply Last reply Reply Quote 0
                  • marcellocM
                    marcelloc
                    last edited by

                    Sorry buto if a user clones the mac and the ip address, I have no idea how ipguard could detect it.

                    You will need to include this security check on switch too.

                    Treinamentos de Elite: http://sys-squad.com

                    Help a community developer! ;D

                    1 Reply Last reply Reply Quote 0
                    • J
                      jikjik101
                      last edited by

                      This is like the DHCP server feature:

                      Deny unknown clients
                      If this is checked, only the clients defined below will get DHCP leases from this server.

                      and

                      Enable Static ARP entries
                      Note: Only the machines listed below will be able to communicate with the firewall on this NIC.

                      Although i have no idea what's the difference between the two features ???

                      1 Reply Last reply Reply Quote 0
                      • marcellocM
                        marcelloc
                        last edited by

                        @jikjik101:

                        Although i have no idea what's the difference between the two features ???

                        The diference is that you can create acls for multiple matches or restrict arp check only for servers ips for example.

                        Treinamentos de Elite: http://sys-squad.com

                        Help a community developer! ;D

                        1 Reply Last reply Reply Quote 0
                        • J
                          jikjik101
                          last edited by

                          I see. But if the OP's requirements is just to prevent users from accessing the network even if they change their IPs, are the features of the DHCP not enough for that as what i posted before, especially this: Enable Static ARP entries? If no, then i need to install this package.  ;D

                          1 Reply Last reply Reply Quote 0
                          • P
                            phil.davis
                            last edited by

                            Just had a play with this and posted a pull request for a few code tidy/fix-ups - @marcelloc, have a look.

                            @jikjik101 -

                            1. I assume that all wireless is secured by good passwords/keys - so only authorised users connect to your wireless, and that all your authorised users (on wireless and cabled) have hardware and network configs that are under your control (or you really do trust them not to hack) - e.g. they are all getting DHCP from your pfSense and maybe are even given static IPs based on their MAC address.

                            Now, if someone carries in a box of their own, plugs it onto your network (attaches a cable to a spare wall socket…) then they can make their box be any MAC address and any IP address. The DHCP server will never get asked for an address.

                            If they just pick an unused IP address in your subnet, then ipguard will make life hell for them.

                            If they try to pretend to be one of your devices by just setting their IP to match one of yours then ipguard will also give them hell - but they might also cause some annoyance to the real device until they are tracked down and removed.

                            If they set their MAC address and IP address to match your real device, then nothing on an ordinary switched LAN can tell the difference.

                            To fix that, you need managed switches that know which MAC address is allowed to be on the end of each port. And obviously physically secure the ports of things you care about - otherwise someone walks into an unattended office, unplugs some critical device, plugs in their own and imitates it. Yes - in places that want high security, this is done for every switch port, unused ones are disables, every time someone moves a device to another room they have to patch it through to the same switch port or get the switch config changed.

                            In the end, you have to first have physical security.

                            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                            1 Reply Last reply Reply Quote 0
                            • R
                              rjcrowder
                              last edited by

                              I've gotta be doing something wrong… I can't seem to get Ipguard working for what I want. This is what is in my /usr/local/etc/ipguard_lan.conf

                              00:e0:52:c2:e0:c4 192.168.5.1 pfsense LAN interface
                              00:25:ae:28:38:a9 192.168.5.200 XBox-Wired
                              00:0d:4b:bd:d1:61 192.168.5.201 roku-basement
                              00:0d:4b:df:c1:3d 192.168.5.202 roku-den
                              cc:6d:a0:1f:a5:11 192.168.5.203 roku-family-rm
                              00:0d:4b:e8:1e:59 192.168.5.204 roku-master-bdrm
                              00:13:72:98:dc:2b 192.168.5.205 rjc-nas
                              00:22:58:7b:85:97 192.168.5.206 Brother-MFC-J430W
                              00:00:00:00:00:00 192.168.5.0/24 lan net

                              I'm trying to set it up so that no MAC other than those listed above can use the 200-207 IP addresses on my network and get out to the internet - but to no avail. I can set my laptop to 206 address (Brother-MFC-J430W listed above) and it seems to have no affect whatsoever. I can browse the internet, etc. What am I doing wrong?

                              Additional info about my setup... I'm using Squid and Dansguardian. The reason I'm trying to stop other MAC's from taking the 200-207 addresses is that 192.168.5.200/29 is allowed out without going through Dans (I have firewall rules that block all other addresses from hitting the internet directly).

                              Thanks for any help!

                              1 Reply Last reply Reply Quote 0
                              • C
                                CrackBlue
                                last edited by

                                I really liked the idea on this package.. but somehow, even if I add the mac-ip pairs, still ipguard gives the machine a de:ad mac address.. lotsa flipflops..
                                any idea on this matter? is there any configuration should i worried about? oh im
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.249 f4:6d:4:6d:ff:c3 (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 de:ad:36:87:f7:6c (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.33 de:ad:36:87:f7:6c (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 de:ad:96:87:d0:9e (de:ad:36:87:f7:6c)
                                Aug 29 20:47:34 isfw arpwatch: reused old ethernet address 192.168.100.215 50:e5:49:a6:c9:64 (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 de:ad:36:87:f7:6c (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.33 de:ad:36:87:f7:6c (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 de:ad:96:87:d0:9e (de:ad:36:87:f7:6c)
                                Aug 29 20:47:34 isfw arpwatch: reused old ethernet address 192.168.100.215 50:e5:49:a6:c9:64 (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: reused old ethernet address 192.168.100.249 de:ad:36:87:f7:6c (f4:6d:4:6d:ff:c3)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.249 f4:6d:4:6d:ff:c3 (de:ad:36:87:f7:6c)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 de:ad:96:87:d0:9e (50:e5:49:a6:c9:64)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.215 50:e5:49:a6:c9:64 (de:ad:96:87:d0:9e)
                                Aug 29 20:47:34 isfw arpwatch: flip flop 192.168.100.38 de:ad:96:87:d0:9e (de:ad:36:87:f7:6c)

                                1 Reply Last reply Reply Quote 0
                                • S
                                  SeventhSon
                                  last edited by

                                  For the flipflops, I have a systen with wireless bridges that mess with MAC addresses (ARP-NAT?) I see this on wireless clients hopping from one bridge to another. Are you running anything like that?

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    CrackBlue
                                    last edited by

                                    i dont have any wireless on my network, flipflops only appear when i turn ipguard to ON. dont know why it didnt recognize the mac-ip pairs defined on the ether file.

                                    1 Reply Last reply Reply Quote 0
                                    • R
                                      rjcrowder
                                      last edited by

                                      @rjcrowder:

                                      I've gotta be doing something wrong… I can't seem to get Ipguard working for what I want. This is what is in my /usr/local/etc/ipguard_lan.conf

                                      00:e0:52:c2:e0:c4 192.168.5.1 pfsense LAN interface
                                      00:25:ae:28:38:a9 192.168.5.200 XBox-Wired
                                      00:0d:4b:bd:d1:61 192.168.5.201 roku-basement
                                      00:0d:4b:df:c1:3d 192.168.5.202 roku-den
                                      cc:6d:a0:1f:a5:11 192.168.5.203 roku-family-rm
                                      00:0d:4b:e8:1e:59 192.168.5.204 roku-master-bdrm
                                      00:13:72:98:dc:2b 192.168.5.205 rjc-nas
                                      00:22:58:7b:85:97 192.168.5.206 Brother-MFC-J430W
                                      00:00:00:00:00:00 192.168.5.0/24 lan net

                                      I'm trying to set it up so that no MAC other than those listed above can use the 200-207 IP addresses on my network and get out to the internet - but to no avail. I can set my laptop to 206 address (Brother-MFC-J430W listed above) and it seems to have no affect whatsoever. I can browse the internet, etc. What am I doing wrong?

                                      Additional info about my setup... I'm using Squid and Dansguardian. The reason I'm trying to stop other MAC's from taking the 200-207 addresses is that 192.168.5.200/29 is allowed out without going through Dans (I have firewall rules that block all other addresses from hitting the internet directly).

                                      Thanks for any help!

                                      I ended up solving my problem by writing a little shell script that executes tcpdump looking for packets with sources range 192.168.5.200/29. It then compares the MAC address on each packet to a list of valid MAC/IP pairs. If a mismatch is found, it shuts down the WAN interface (assumption being a rogue MAC has taken one of my unfiltered IP addresses)! A little draconian, but effective. Added a startup/shutdown script for it and it accomplishes what I want…

                                      However - I thought I could accomplish the same thing with ipguard... can anyone tell me? Thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • R
                                        rjcrowder
                                        last edited by

                                        Bump…

                                        Not a big deal because I got it working with the tcpdump shell script, but I'm still wondering if my use case was valid for ipguard? i.e. should I be able to make ipguard work to block invalid mac/ip combos from accessing the internet?

                                        Anyone? Thanks...

                                        1 Reply Last reply Reply Quote 0
                                        • marcellocM
                                          marcelloc
                                          last edited by

                                          try to reduce your network range on your allow list and move pfsense ip to 254 for example.

                                          00:e0:52:c2:e0:c4 192.168.5.254 pfsense LAN interface
                                          .
                                          .
                                          .
                                          00:00:00:00:00:00 192.168.5.0/25 lan net

                                          Treinamentos de Elite: http://sys-squad.com

                                          Help a community developer! ;D

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            rjcrowder
                                            last edited by

                                            OK… seems like I tried that, but I will play around with it some more... Before I do though, I just want to confirm. What I'm trying to do is what ipguard was intended to accomplish? i.e. make sure that ip/mac combinations (or ranges) are valid and keep invalid combos from accessing network resources?

                                            Also (again I'll play more to confirm) I turned on the verbose logging and from what I could tell, it appeared that ipguard was catching the invalid mac/ip combination and returning the bogus mac address on the ARP request/reply. However, everything still worked for the IP address involved. It shouldn't... correct?

                                            Thanks again...

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