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.
    • S
      Supermule Banned
      last edited by

      Are you hosting your own mailserver?

      It doesnt work if your uplink mailexchanger is not in a blacklistet country or have CB installed. Therefore the FW is not blocking the mails….

      Very simple.

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

        @tommyboy180:

        I could look and see if I have a backup of the old version but it would be moot. The underlying way that 1.9 and any other version including 1.0 works is by editing the pf firewall. 1.9 just has some nice bells and whistles but it's not to different the my first version.

        Can you locate the IPs or even a single IP that continues to SPAM you? We can find out exactly what is going on if you can give me some IPs.

        Well going back probably isn't the problem as no one else is mentioning anything.  It has to be something on my box here.

        For some IPs:
        187.0.71.242 - Brazil
        84.55.115.109 - Sweden
        95.153.123.72 - Moldova, Republic of
        122.178.183.132 - India
        110.136.188.169 - Indonesia
        110.138.16.91 - Indonesia
        41.182.128.63 - Namibia
        95.132.175.117 - Ukraine
        178.94.120.115 - (emailed twice, ?)
        89.254.241.130 - Russian Federation
        89.231.54.200 - Poland
        110.136.251.98 - Indonesia

        These are just from spam I received last night…  I go to here for IP lookup.

        Are you hosting your own mailserver?

        It doesnt work if your uplink mailexchanger is not in a blacklistet country or have CB installed. Therefore the FW is not blocking the mails….

        Very simple.

        Well I am piggy backing off my ISPs relay server settings but yes I have my own email residing on my own server/domain.  Nothing overly fancy but an educational project all together.  I got every country except the US selected and I seemed to be able to successfully block all spam on the old bsd box where if I unblocked a country then the next day I may have a few from that country.  What is simple to you is still quite a challenge for me…thank you though for your patience.

        1 Reply Last reply Reply Quote 0
        • S
          Supermule Banned
          last edited by

          Did you change mailserver software when changing bsd box?

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

            @Supermule:

            Did you change mailserver software when changing bsd box?

            Mailserver software…I didn't change anything on my server except the static IP so that it would reflect the new network.  My server resides on Opt2.  Was there a switch somewhere in the bsd box that I may have quite possibly overlooked?  I did compare the two before switching them out however with all the details and human error it is quite possible.

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

              @mgc6288:

              @Supermule:

              Did you change mailserver software when changing bsd box?

              Mailserver software…I didn't change anything on my server except the static IP so that it would reflect the new network.  My server resides on Opt2.  Was there a switch somewhere in the bsd box that I may have quite possibly overlooked?  I did compare the two before switching them out however with all the details and human error it is quite possible.

              Can you PM me the contents of /tmp/rules.debug  Make sure countryblock is running before sending me the contents.
              You can also email to me if you like.

              -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
              • M
                mgc6288
                last edited by

                Well I plugged in the old bsd box and walla…not a piece of spam except three marked from the US.  So I looked over everything and the only change I could see was the MAC address of the WAN which gave me a different IP so I cloned it to keep the old IP address and then I put the Server on LAN.  We'll see what happens next.

                UPDATE:
                Well I got a ton of spam again.  There must be some hidden change between the two as one blocks and the other doesn't.  The CB, LAN, NAT, and Rules settings are all the same.

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

                  @mgc6288:

                  Well I plugged in the old bsd box and walla…not a piece of spam except three marked from the US.  So I looked over everything and the only change I could see was the MAC address of the WAN which gave me a different IP so I cloned it to keep the old IP address and then I put the Server on LAN.  We'll see what happens next.

                  UPDATE:
                  Well I got a ton of spam again.  There must be some hidden change between the two as one blocks and the other doesn't.  The CB, LAN, NAT, and Rules settings are all the same.

                  Can you zip the contents of /usr/local/www/packages/countryblock and email it to me. I will compare line by line and see what could have changed for you. Also email me your xml config. I want to replicate your issues in a virtual network over here. Your problem really intrigues me since I have no clue what the problem may be.

                  -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
                    tux3132
                    last edited by

                    Hi everybody

                    First of all a great thank to Countryblock developers !

                    I have not understood what the email tab is used to ?

                    Therefore I have configured it.

                    SMTP auth no (All hosts on the lan can access the Postfix server)
                    SMTP security none
                    Host my_mail_server
                    Port 25
                    Username leave_blank
                    Password leave_blank
                    From email address my_own_address
                    To email address admin_address
                    Subject Test

                    When I click "Save" I have a blank screen and my configuration is not saved when I come back to the email tab.

                    When I fill in username, password after saving I click "Test" and I get the following error message :

                    Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Warning: fsockopen(): unable to connect to none://zimbra:25 in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Mailer Error: SMTP Error: Could not connect to SMTP host.

                    I have the same error when I replace the name of my mail server with its IP address.

                    Any ideas ?

                    Anticipated thanks.

                    Best regards.

                    Bernard

                    Bernard

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

                      @tux3132:

                      Hi everybody

                      First of all a great thank to Countryblock developers !

                      I have not understood what the email tab is used to ?

                      Therefore I have configured it.

                      SMTP auth no (All hosts on the lan can access the Postfix server)
                      SMTP security none
                      Host my_mail_server
                      Port 25
                      Username leave_blank
                      Password leave_blank
                      From email address my_own_address
                      To email address admin_address
                      Subject Test

                      When I click "Save" I have a blank screen and my configuration is not saved when I come back to the email tab.

                      When I fill in username, password after saving I click "Test" and I get the following error message :

                      Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Warning: fsockopen(): unable to connect to none://zimbra:25 in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Mailer Error: SMTP Error: Could not connect to SMTP host.

                      I have the same error when I replace the name of my mail server with its IP address.

                      Any ideas ?

                      Anticipated thanks.

                      Best regards.

                      Bernard

                      Bernard,

                      I believe this was addressed on page 20 as I had a similar problem…go back a few pages and you should find the answer.  I'll let you know when I get to this point of pfsense.

                      Right now I succumbed to hitting the "Factory defaults" button but this time I am incrementally setting up pfsense.  Only LAN and WAN are configured leaving OPT1,2,3,4,5 offline along with configuring the Aliases, NAT, and Rules.  I installed CB and wow...not a single spam since setup last night.  I'm leaning towards the conclusion that there was some odd switch flipped or forgotten on the last setup as it is working now, or so it seems.  Tonight I will backup my current configuration and attempt a few more settings.

                      I know this has been mentioned before and I believe the reason it was mentioned not done was due to a certain clearance level was needed but having a log just for CB showing what has been blocked for x hours/days would be awesome if just to confirm that stuff is blocked and that nothing has gone array with the configuration.  I know the System logs --> firewall are supposed to list something but I'm not familiar with deciphering what was blocked because of CB and what was for something else.

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

                        I cannot for the life of me KEEP countryblock running.  I've been all over this forum trying to find a resolution that works.  I've implemented cron jobs to restart the app, which it does, however it doesnt appear to truly be running as, even though I have block outbound checked, I can still connect to countries that are checked.  Ive tried uninstalling every package I have, reinstalling CB, restarting the box PFsense is running on, everything I can possibly think of and yet after 5-15 minutes CB just stops working. I have to manually restart it, it works, then a few minutes later its not working again even though the logs say that it was found not running, then cron restarts it, but its not actually working.  Sooo frustrating.

                        Can anyone help?  What do I need to provide?

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

                          I had a similar problem myself and the outbound does work but what I found is that I had to make sure ALL the interfaces are selected and then go to:

                          /usr/local/www/packages/countryblock/interfaces.txt

                          delete any text in there and replace simply with "any" (no quotes).

                          1 Reply Last reply Reply Quote 0
                          • Y
                            yaw
                            last edited by

                            Any ideas why Country Block doesn't start automatically after a system reboot? I'm running the embedded pfsense 2.0beta4 on an alix device. I have to go in and select enable after each reboot to start it.

                            Thanks.

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

                              @mgc6288:

                              I had a similar problem myself and the outbound does work but what I found is that I had to make sure ALL the interfaces are selected and then go to:

                              /usr/local/www/packages/countryblock/interfaces.txt

                              delete any text in there and replace simply with "any" (no quotes).

                              Thanks for the assistance!  I checked that file and indeed 'any' is the only text in that file.

                              I uninstalled lightsquid thinking that perhaps it is causing the issue, considering I see a cronjob running a lightsquid script every 15 minutes.  That did not work.  For some reason, every 15 minutes it shuts down even though it appears to be running.  Very odd.

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

                                @yaw:

                                Any ideas why Country Block doesn't start automatically after a system reboot? I'm running the embedded pfsense 2.0beta4 on an alix device. I have to go in and select enable after each reboot to start it.

                                Thanks.

                                Have you had any other issues with CB while using the 2.0 beta of pfsense?  If not I may give the beta a shot since I cannot seem to resolve my current issues with CB on 1.23.

                                1 Reply Last reply Reply Quote 0
                                • Y
                                  yaw
                                  last edited by

                                  Yeah the email setting page doesn't work. I get a crazy long SSL error when I try and submit a test email. I figure I'll tackle that once I figure out how to start it automatically upon reboot.

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

                                    Good luck mate.

                                    FWIW it appears that either squid or a misconfiguration of squid is what was causing my issue.  I removed squids cron jobs and uninstalled the package again, and now CB seems to stay running.  Going to test for a day and see what happens.  Hopefully I can figure out how to have both co-exist happily as I like squid.

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

                                      @mgc6288:

                                      @tux3132:

                                      Hi everybody

                                      First of all a great thank to Countryblock developers !

                                      I have not understood what the email tab is used to ?

                                      Therefore I have configured it.

                                      SMTP auth no (All hosts on the lan can access the Postfix server)
                                      SMTP security none
                                      Host my_mail_server
                                      Port 25
                                      Username leave_blank
                                      Password leave_blank
                                      From email address my_own_address
                                      To email address admin_address
                                      Subject Test

                                      When I click "Save" I have a blank screen and my configuration is not saved when I come back to the email tab.

                                      When I fill in username, password after saving I click "Test" and I get the following error message :

                                      Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Warning: fsockopen(): unable to connect to none://zimbra:25 in /usr/local/www/packages/countryblock/class.smtp.php on line 122 Mailer Error: SMTP Error: Could not connect to SMTP host.

                                      I have the same error when I replace the name of my mail server with its IP address.

                                      Any ideas ?

                                      Anticipated thanks.

                                      Best regards.

                                      Bernard

                                      Bernard,

                                      I believe this was addressed on page 20 as I had a similar problem…go back a few pages and you should find the answer.  I'll let you know when I get to this point of pfsense.

                                      Right now I succumbed to hitting the "Factory defaults" button but this time I am incrementally setting up pfsense.  Only LAN and WAN are configured leaving OPT1,2,3,4,5 offline along with configuring the Aliases, NAT, and Rules.  I installed CB and wow...not a single spam since setup last night.  I'm leaning towards the conclusion that there was some odd switch flipped or forgotten on the last setup as it is working now, or so it seems.  Tonight I will backup my current configuration and attempt a few more settings.

                                      I know this has been mentioned before and I believe the reason it was mentioned not done was due to a certain clearance level was needed but having a log just for CB showing what has been blocked for x hours/days would be awesome if just to confirm that stuff is blocked and that nothing has gone array with the configuration.  I know the System logs --> firewall are supposed to list something but I'm not familiar with deciphering what was blocked because of CB and what was for something else.

                                      I have removed IP-Blocklist
                                      I have enabled all interfaces
                                      I have tested that from my PFSense box my mail server could be contacted

                                      No success I have the same error : fsockopen(): php_network_getaddresses …

                                      Any Idea

                                      Best regards.

                                      Bernard

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

                                        The email feature uses phpmailer which is separate from the countryblock package. If your having problems with email you should check to make sure your settings reflect what the mail provider requires. I do know it's really simple to get gmail on the email feature so please double check your settings.

                                        -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
                                        • Y
                                          yaw
                                          last edited by

                                          Thanks for the tip. I'll look at that today. Any thoughts on the reboot problem?

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

                                            @yaw:

                                            Thanks for the tip. I'll look at that today. Any thoughts on the reboot problem?

                                            Check that /usr/local/etc/rc.d/countryblock.sh exists. This is the script that starts the package on boot.

                                            -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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.