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

    Country Block

    Scheduled Pinned Locked Moved pfSense Packages
    691 Posts 79 Posters 679.7k 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.
    • X
      XIII
      last edited by

      google apps users use @yourdomain.com but other than that it is googles servers (smtp.gmail.com, smtp.googlemail.com etc)

      -Chris Stutzman
      Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
      Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
      freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
      Check out the pfSense Wiki

      1 Reply Last reply Reply Quote 0
      • T
        tommyboy180
        last edited by

        @XIII:

        google apps users use @yourdomain.com but other than that it is googles servers (smtp.gmail.com, smtp.googlemail.com etc)

        Yes that's right. That's how I setup my email. I'm not sure, it should. I'm using smtp.gmail.com as the gateway, so as long as it authenticates it will work.
        I hope to have this out soon, so you will be able to test here shortly.

        -Tom Schaefer
        SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

        Please support pfBlocker | File Browser | Strikeback

        1 Reply Last reply Reply Quote 0
        • X
          XIII
          last edited by

          well since google is making all gapps accounts full (almost) google accounts, one can log in at gmail.com with their full email address and get ones email.

          I will be glad to be the first tester!

          -Chris Stutzman
          Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
          Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
          freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
          Check out the pfSense Wiki

          1 Reply Last reply Reply Quote 0
          • T
            tommyboy180
            last edited by

            I've got email working right now. I was able to use any SMTP gateway, so email will not be restricted to gmail. So far I have successfully tested yahoo SMTP and gmail SMTP, but there isn't a reason why any SMTP gateway won't work.
            Right now this is only on php4 and if I'm not mistaken php5 is on pfsense BETA 2. I don't have BETA 2 so I will need a tester here in a couple days if anyone wants to help out.

            -Tom Schaefer
            SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

            Please support pfBlocker | File Browser | Strikeback

            1 Reply Last reply Reply Quote 0
            • B
              Bai Shen
              last edited by

              I'm still having trouble with CB staying running.  Is there anything I should look at?

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

                @Bai:

                I'm still having trouble with CB staying running.  Is there anything I should look at?

                Which version of CB are you using?

                And PfSense version?

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

                  @tommyboy180:

                  Not checking your WAN interface will leave you vulnerable to attack from your blocked counties. However, yes. If you do not select your WAN and your LAN, then you will be able to enforce outbound access, on the DMZ, to the countries while still being able to access them on your LAN.
                  For a customized configuration you can always edit /usr/local/www/packages/countryblock/execute.sh to give you more control over how you want to block access to the countries.

                  I see.  So to block all incoming I just keep the WAN checked and then if I check "Block outbound" and uncheck my personal LAN then my server and son's computer will be outbound blocked but mine will be unaffected even though all incoming is blocked?  Just clarifying.  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • T
                    tommyboy180
                    last edited by

                    @mgc6288:

                    @tommyboy180:

                    Not checking your WAN interface will leave you vulnerable to attack from your blocked counties. However, yes. If you do not select your WAN and your LAN, then you will be able to enforce outbound access, on the DMZ, to the countries while still being able to access them on your LAN.
                    For a customized configuration you can always edit /usr/local/www/packages/countryblock/execute.sh to give you more control over how you want to block access to the countries.

                    I see.  So to block all incoming I just keep the WAN checked and then if I check "Block outbound" and uncheck my personal LAN then my server and son's computer will be outbound blocked but mine will be unaffected even though all incoming is blocked?  Just clarifying.  Thanks.

                    That is correct. You should be able to test this easily by accessing a site located in one of the countries and using a proxy located in the country. That's how I have been checking to make sure I understand how it works (I'm a visual learner).

                    -Tom Schaefer
                    SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                    Please support pfBlocker | File Browser | Strikeback

                    1 Reply Last reply Reply Quote 0
                    • T
                      tommyboy180
                      last edited by

                      Version 1.8 Released

                      Changes:

                      • Email notifications

                      • New cron script

                      • System logging

                      Thank you all for your support. The new cron script (/usr/local/etc/rc.d/countryblock.sh) checks if it's running before doing anything. If it's running it exits, if not it will send you an email telling you it's restarting, make a system log entry, and the restart countryblock.
                      Email notifications use SMTP. Any SMTP sever works, not just gmail like I originally planned. Your email password is stored in plain text in a file called email_send.php for those who are paranoid.
                      Thanks again everyone.

                      138.jpg
                      138.jpg_thumb

                      -Tom Schaefer
                      SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                      Please support pfBlocker | File Browser | Strikeback

                      1 Reply Last reply Reply Quote 0
                      • K
                        kilthro
                        last edited by

                        wow thats awesome!!!

                        Gonna give it a try. Thanks for the updates!!!!

                        1 Reply Last reply Reply Quote 0
                        • D
                          DigitalJer
                          last edited by

                          The hits just keep on comin!

                          Thanks much TB - strong work indeed!

                          –------------------------------------------------
                          2.4.3-RELEASE (amd64)
                          built on Mon Mar 26 18:02:04 CDT 2018
                          FreeBSD 11.1-RELEASE-p7
                          VM in ESXi 5.5
                          1 x 1000baseTX (WAN)
                          1 x 1000baseTX (LAN)

                          1 Reply Last reply Reply Quote 0
                          • B
                            Bai Shen
                            last edited by

                            @robfantini:

                            Which version of CB are you using?

                            And PfSense version?

                            Newest of both.  1.7 and 1.2.3

                            It's still running today from yesterday.  So I'm guessing my problem is that I can't always tell when something will make a firewall change and force me to restart CB.

                            Is there any way to have CB be part of the firewall restart?  Surely there has to be some sort of hook for that.

                            1 Reply Last reply Reply Quote 0
                            • T
                              tommyboy180
                              last edited by

                              @Bai:

                              @robfantini:

                              Which version of CB are you using?

                              And PfSense version?

                              Newest of both.  1.7 and 1.2.3

                              It's still running today from yesterday.  So I'm guessing my problem is that I can't always tell when something will make a firewall change and force me to restart CB.

                              Is there any way to have CB be part of the firewall restart?  Surely there has to be some sort of hook for that.

                              It's possible. I have been trying to make countryblock more integrated since the day I started development. I never figured it out. I'm hoping that I will soon or someone will.

                              -Tom Schaefer
                              SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                              Please support pfBlocker | File Browser | Strikeback

                              1 Reply Last reply Reply Quote 0
                              • D
                                DigitalJer
                                last edited by

                                Trying out the email config:  entered in the applicable settings, clicked Save, and this error appears:

                                Couldn't write values to file!

                                Navigating again to the email tab reveals this line:

                                Your settings have already been set. Would you like to overwrite your email settings?

                                Warning: file_get_contents(email_config.html): failed to open stream: No such file or directory in /usr/local/www/packages/countryblock/email.php on line 172

                                Uninstalling / re-installing doesn't seem to help :(

                                –------------------------------------------------
                                2.4.3-RELEASE (amd64)
                                built on Mon Mar 26 18:02:04 CDT 2018
                                FreeBSD 11.1-RELEASE-p7
                                VM in ESXi 5.5
                                1 x 1000baseTX (WAN)
                                1 x 1000baseTX (LAN)

                                1 Reply Last reply Reply Quote 0
                                • T
                                  tommyboy180
                                  last edited by

                                  @DigitalJer:

                                  Trying out the email config:  entered in the applicable settings, clicked Save, and this error appears:

                                  Couldn't write values to file!

                                  Navigating again to the email tab reveals this line:

                                  Your settings have already been set. Would you like to overwrite your email settings?

                                  Warning: file_get_contents(email_config.html): failed to open stream: No such file or directory in /usr/local/www/packages/countryblock/email.php on line 172

                                  Uninstalling / re-installing doesn't seem to help :(

                                  Are you leaving a field blank? If so which field?
                                  EDIT: Which browser are you using?

                                  -Tom Schaefer
                                  SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                                  Please support pfBlocker | File Browser | Strikeback

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    DigitalJer
                                    last edited by

                                    @tommyboy180:

                                    Are you leaving a field blank? If so which field?
                                    EDIT: Which browser are you using?

                                    Yep, leaving Username and Password blank, as my ISP doesn't require that info.  I can just use Gmail, if that will satisfy CB ?

                                    Using Chrome.

                                    EDIT:  works great with Gmail (all fields filled in).

                                    Thanks tho :)

                                    –------------------------------------------------
                                    2.4.3-RELEASE (amd64)
                                    built on Mon Mar 26 18:02:04 CDT 2018
                                    FreeBSD 11.1-RELEASE-p7
                                    VM in ESXi 5.5
                                    1 x 1000baseTX (WAN)
                                    1 x 1000baseTX (LAN)

                                    1 Reply Last reply Reply Quote 0
                                    • X
                                      XIII
                                      last edited by

                                      All fields must be filled in for the email function to work.
                                      Dont forget that for it to be able to restart CB you must have started it at least once.

                                      -Chris Stutzman
                                      Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
                                      Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
                                      freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
                                      Check out the pfSense Wiki

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

                                        @DigitalJer:

                                        Could you post your gmail settings?

                                        1 Reply Last reply Reply Quote 0
                                        • X
                                          XIII
                                          last edited by

                                          @DigitalJer  set SMTP Auth = No and see if that works

                                          @robfantini
                                          You did the quote wrong.

                                          But heres the info you requested:
                                          SMTP Auth = Yes
                                          SMTP Security = Yes
                                          Host = smtp.gmail.com  (this is for gmail and GApps users)
                                          Port = 465
                                          User name = your full username (test@gmail.com)
                                          Password = your password
                                          Use HTML Formatting = Yes
                                          From Email address = your full username (test@gmail.com)
                                          To Email address = email you are sending notifications to
                                          Subject = whatever you want

                                          -Chris Stutzman
                                          Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
                                          Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
                                          freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
                                          Check out the pfSense Wiki

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

                                            @XIII:

                                            @DigitalJer  set SMTP Auth = No and see if that works

                                            @robfantini
                                            You did the quote wrong.

                                            But heres the info you requested:
                                            SMTP Auth = Yes
                                            SMTP Security = Yes
                                            Host = smtp.gmail.com  (this is for gmail and GApps users)
                                            Port = 465
                                            User name = your full username (test@gmail.com)
                                            Password = your password
                                            Use HTML Formatting = Yes
                                            From Email address = your full username (test@gmail.com)
                                            To Email address = email you are sending notifications to
                                            Subject = whatever you want

                                            thank you, that worked.  I had been using the wrong port.

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