MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    ipWhitelist HowTo

    Scheduled Pinned Locked Moved Tutorials
    83 Posts 36 Posters 145.0k Views 34 Watching
    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.
    • K Offline
      krisalexroberts @mochman
      last edited by

      The reason why “/24” works
      A couple different threads state to add /24 to the end of the IP address. (I’ve put a couple of those up before doing some research too). While this will indeed allow your network devices access to your magic mirror, it will also allow any device with an IPv4 based address access to your mirror (obviously your router would need to be configured to allow this).
      This “/24” in IPv6 CIDR allows 20,282,409,603,651,670,423,947,251,286,016 different IP addresses access. (IPv4’s total addresses are 4,294,967,296).


      More information
      If you’d like to learn more or have different sub-netting needs, I found this page useful.

      I don’t ageee with that. 192.167.1.0/24 is everything in the 192.168.1.x range, nothing more nothing less. If it allows more than this is a massive flaw/security risk.

      If you want to allow your own subnet then just look at your subnet mask and use google to get the CIDR

      1 Reply Last reply Reply Quote 0
      • P Offline
        pingywon
        last edited by

        I agree that /24 is 255.255.255.0 or 192.268.x.0 to 192.168.x.255

        That’s why these issues are making me crazy aka can’t figure them out.

        1 Reply Last reply Reply Quote 0
        • P Offline
          pingywon
          last edited by

          FOUND A WAY TO RESOLVE THIS!

          Add

          cat /etc/modprobe.d/ipv6.conf 
          # Don't load ipv6 by default
          alias net-pf-10 off
          # uncommented
          alias ipv6 off
          # added
          options ipv6 disable_ipv6=1
          # this is needed for not loading ipv6 driver 
          blacklist ipv6
          

          to turn off all IPv6 on the Raspi.
          Than edit all the IPv6 out of your config file.

           },
                  ipWhitelist: [
                          "192.168.0.92",
                          "192.168.0.1/24",
                          "127.0.0.1"
          
          

          I still have the .92 in there from testing. It is not needed.

          did a sudo reboot just for safe measure and now it all seems to be working as intended. No real idea what the actual issue was…but it is resolved. FINALLY! :)

          1 Reply Last reply Reply Quote 1
          • lavolp3L Offline
            lavolp3 Module Developer
            last edited by lavolp3

            Maybe I have missed this from someone else, but one important thing about the whitelisting message:

            “This device is not allowed to access your mirror.
            Please check your config.js or config.js.sample to change this.”
            

            The EXACT SAME message appears (in my case) if the config.js has syntax errors. Locally your mirror will tell you that there is no config file or just give you a black screen, but if you try to reach it from outside through a browser (Firefox and Chrome in my case) with a broken config.js, you will get the whitelisting message above.

            So, before trying to get your ipWhitelist in the right shape, make sure you have no other syntax errors with the mirror, e.g. using

            npm run config:check
            

            If you had some and had them corrected, be safe and restart the mirror.
            Below you can see the example in my case.

            pi@magicmirror2:~ $ tail ~/.pm2/logs/mm-out-0.log
            No helper found for module: helloworld.
            All module helpers loaded.
            Starting server on port 8080 ...
            Server started ...
            Connecting socket for: updatenotification
            Sockets connected & modules started ...
            Launching application.
            Access denied to IP address: 66.249.93.64
            Access denied to IP address: 80.157.5.50
            Access denied to IP address: 80.157.5.50
            pi@magicmirror2:~ $ cd MagicMirror/
            pi@magicmirror2:~/MagicMirror $ npm run config:check
            
            > magicmirror@2.1.2 config:check /home/pi/MagicMirror
            > node tests/configs/check_config.js
            
            Checking file...  /home/pi/MagicMirror/config/config.js
            Line 260 col 9 Expected ']' to match '[' from line 26 and instead saw '{'.
            Line 261 col 16 Expected '}' to match '{' from line 11 and instead saw 'module'.
            Line 261 col 22 Missing semicolon.
            Line 261 col 16 Unrecoverable syntax error. (95% scanned).
            pi@magicmirror2:~/MagicMirror $ sudo nano config/config.js
            pi@magicmirror2:~/MagicMirror $ npm run config:check
            
            > magicmirror@2.1.2 config:check /home/pi/MagicMirror
            > node tests/configs/check_config.js
            
            Checking file...  /home/pi/MagicMirror/config/config.js
            Your configuration file don't containt syntax error :)
            pi@magicmirror2:~/MagicMirror $ pm2 restart mm
            Use --update-env to update environment variables
            [PM2] Applying action restartProcessId on app [mm](ids: 0)
            [PM2] [mm](0) ✓
            ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
            │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
            ├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
            │ mm       │ 0  │ fork │ 901 │ online │ 6       │ 0s     │ 18% │ 2.3 MB   │ pi   │ disabled │
            └──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
             Use `pm2 show ` to get more details about an app
            pi@magicmirror2:~/MagicMirror $
            
            
            ToddKlindtT 1 Reply Last reply Reply Quote 1
            • G Offline
              Gxnfr Ali @mochman
              last edited by

              @mochman said in ipWhitelist HowTo:

              tail -f ~/.pm2/logs/mm-out-0.log

              Use pm2 show to get more details about an app
              pi@raspberry:~ $ tail -f ~/.pm2/logs/mm-out-0.log
              Initializing new module helper …
              Module helper loaded: MMM-OnScreenMenu
              No helper found for module: compliments.
              No helper found for module: MMM-PrayerTime.
              No helper found for module: MMM-Advent.
              Initializing new module helper …
              Module helper loaded: MMM-FRITZ-Box-Callmonitor
              No helper found for module: MMM-Callmonitor-Current-Call.
              No helper found for module: currentweather.
              No helper found for module: weatherforecast.

              no find out ipWhiteList

              1 Reply Last reply Reply Quote 0
              • O Offline
                Oss
                last edited by Oss

                I just updated to the latest version of MM and am having White-list issues once again. I am using my exact same config.js file that was allowing any incoming connection. prior to the upgrade. I have attempted to debug but am not seeing any connection refusals in the mm-out-0.log. I have tried various fixes from posts on this forum, including disabling IPv6. I have confirmed my CIDR criteria using https://www.ipaddressguide.com/cidr#range attempting different variations to get anything to pass through with no luck.

                I use MMM-syslog as a notification system from various sources and am basically in the dark now. Is there anyone having similar issues with the latest version, any luck on how to fix?

                Mykle1M 1 Reply Last reply Reply Quote 0
                • Mykle1M Offline
                  Mykle1 Project Sponsor Module Developer @Oss
                  last edited by

                  @Oss

                  Have you tried this at the beginning of your config?:

                  var config = {
                  	address: "0.0.0.0", 
                  	port: 8080,
                  	ipWhitelist: [],
                  

                  Create a working config
                  How to add modules

                  O 1 Reply Last reply Reply Quote 5
                  • O Offline
                    Oss @Mykle1
                    last edited by

                    @Mykle1

                    My hats off to you Mykle1, made that change to my config file and its working perfectly!! Thank you so much for your quick reply!!

                    Mykle1M 1 Reply Last reply Reply Quote 2
                    • Mykle1M Offline
                      Mykle1 Project Sponsor Module Developer @Oss
                      last edited by

                      @Oss

                      'Welcome, mate.

                      Peace!

                      Create a working config
                      How to add modules

                      1 Reply Last reply Reply Quote 0
                      • I Offline
                        illskool
                        last edited by

                        Hello All. I recently upgraded my magic mirror and no matter what changes I make I can’t get ipwhitelist to work. I have searched the forums and every suggestion I have come across hasn’t rectified my issue. I had it working just fine prior to the upgrade. Any suggestions would be greatly appreciated.

                        Thanks,
                        Illskool

                        lavolp3L 1 Reply Last reply Reply Quote 0
                        • lavolp3L Offline
                          lavolp3 Module Developer @illskool
                          last edited by

                          @illskool

                          How long ago was your last update?

                          Just to be sure, have you tried @Mykle1’s solution, which seems to help in most of the cases this has happened in recent months?

                          var config = {
                              address: "0.0.0.0", 
                              port: 8080,
                              ipWhitelist: [],
                          

                          adding the “address” part on the top of the config? This seems to be mandatory for the newer versions of MM.

                          Also, be sure to have no syntax error in your config.
                          Run

                          npm run config:check
                          

                          from your MM directory and see of there are no errors.
                          Done all that?

                          1 Reply Last reply Reply Quote 0
                          • I Offline
                            illskool
                            last edited by

                            @lavolp3

                            Thanks for the quick response. I’m not sure if I just overlooked it or if I’m just exhausted from trying to figure this issue out for the past several hours, but either way your tip solved my problem. I thank you very much.

                            I’ve been working on a new project to stream a camera I have setup on another raspberry pi on my local network to the magic mirror. My oil tank is under my house in a crawl space and I’m tired of making the crawl every couple of weeks to see how much oil I have left. I was able to use an infrared camera to stream the video and display it on the mirror using Iframe. I didn’t want it to be visible on the mirror unless I wanted to do a quick check and thats when I realized that the remote module would solve my issue but I couldn’t access it. You have helped finish my project. I can now go to sleep:)

                            Cheers

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              svenr
                              last edited by

                              I tried everything wich is written in this post but i cant make it all the time it says:

                              This device is not allowed to access your mirror.
                              Please check your config.js or config.js.sample to change this.

                              Mykle1M 1 Reply Last reply Reply Quote 0
                              • Mykle1M Offline
                                Mykle1 Project Sponsor Module Developer @svenr
                                last edited by

                                @svenr said in ipWhitelist HowTo:

                                Please check your config.js

                                Are you saying that this is in your config.js file and you still cannot connect?

                                var config = {
                                    address: "0.0.0.0", 
                                    port: 8080,
                                    ipWhitelist: [],
                                

                                Create a working config
                                How to add modules

                                S 1 Reply Last reply Reply Quote 0
                                • S Offline
                                  svenr @Mykle1
                                  last edited by svenr

                                  @Mykle1 alt text
                                  Yes right but maybe i have another mistake i am a beginner and i have not really a idea about it
                                  link text

                                  Mykle1M 1 Reply Last reply Reply Quote 0
                                  • Mykle1M Offline
                                    Mykle1 Project Sponsor Module Developer @svenr
                                    last edited by

                                    @svenr

                                    Looking at the picture you provided shows your ipWhitelist: [], is populated. Can you try it just like this? ipWhitelist: [],

                                    Create a working config
                                    How to add modules

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      svenr @Mykle1
                                      last edited by

                                      @Mykle1 like this it works. Thank you for your help!

                                      Mykle1M 1 Reply Last reply Reply Quote 0
                                      • Mykle1M Offline
                                        Mykle1 Project Sponsor Module Developer @svenr
                                        last edited by

                                        @svenr

                                        Good. Now all the devices on your network have access. If you want to limit access to specific devices then you should search this forum for ipWhitelist info. This topic has been discussed at length

                                        Create a working config
                                        How to add modules

                                        1 Reply Last reply Reply Quote 0
                                        • ToddKlindtT Offline
                                          ToddKlindt @lavolp3
                                          last edited by

                                          @lavolp3 said in ipWhitelist HowTo:

                                          Maybe I have missed this from someone else, but one important thing about the whitelisting message:

                                          “This device is not allowed to access your mirror.
                                          Please check your config.js or config.js.sample to change this.”
                                          

                                          The EXACT SAME message appears (in my case) if the config.js has syntax errors. Locally your mirror will tell you that there is no config file or just give you a black screen, but if you try to reach it from outside through a browser (Firefox and Chrome in my case) with a broken config.js, you will get the whitelisting message above.

                                          So, before trying to get your ipWhitelist in the right shape, make sure you have no other syntax errors with the mirror, e.g. using

                                          npm run config:check
                                          

                                          If you had some and had them corrected, be safe and restart the mirror.
                                          Below you can see the example in my case.

                                          pi@magicmirror2:~ $ tail ~/.pm2/logs/mm-out-0.log
                                          No helper found for module: helloworld.
                                          All module helpers loaded.
                                          Starting server on port 8080 ...
                                          Server started ...
                                          Connecting socket for: updatenotification
                                          Sockets connected & modules started ...
                                          Launching application.
                                          Access denied to IP address: 66.249.93.64
                                          Access denied to IP address: 80.157.5.50
                                          Access denied to IP address: 80.157.5.50
                                          pi@magicmirror2:~ $ cd MagicMirror/
                                          pi@magicmirror2:~/MagicMirror $ npm run config:check
                                          
                                          > magicmirror@2.1.2 config:check /home/pi/MagicMirror
                                          > node tests/configs/check_config.js
                                          
                                          Checking file...  /home/pi/MagicMirror/config/config.js
                                          Line 260 col 9 Expected ']' to match '[' from line 26 and instead saw '{'.
                                          Line 261 col 16 Expected '}' to match '{' from line 11 and instead saw 'module'.
                                          Line 261 col 22 Missing semicolon.
                                          Line 261 col 16 Unrecoverable syntax error. (95% scanned).
                                          pi@magicmirror2:~/MagicMirror $ sudo nano config/config.js
                                          pi@magicmirror2:~/MagicMirror $ npm run config:check
                                          
                                          > magicmirror@2.1.2 config:check /home/pi/MagicMirror
                                          > node tests/configs/check_config.js
                                          
                                          Checking file...  /home/pi/MagicMirror/config/config.js
                                          Your configuration file don't containt syntax error :)
                                          pi@magicmirror2:~/MagicMirror $ pm2 restart mm
                                          Use --update-env to update environment variables
                                          [PM2] Applying action restartProcessId on app [mm](ids: 0)
                                          [PM2] [mm](0) ✓
                                          ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
                                          │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
                                          ├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
                                          │ mm       │ 0  │ fork │ 901 │ online │ 6       │ 0s     │ 18% │ 2.3 MB   │ pi   │ disabled │
                                          └──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
                                           Use `pm2 show ` to get more details about an app
                                          pi@magicmirror2:~/MagicMirror $
                                          
                                          

                                          I wanted to quote this as it just happened to me. MM was working fine remotely. I made some edits to config.js and got the dreaded “This device is not allowed to access your mirror…" message. I hadn’t edited the whitelist, so I started doing all of the network troubleshooting. Seeing this post reminded me I had done some edits and sure enough, I missed a comma somewhere and the screwed it all up. Fixing that unrelated entry in the config.js made this error go away.

                                          lavolp3L 1 Reply Last reply Reply Quote 0
                                          • lavolp3L Offline
                                            lavolp3 Module Developer @ToddKlindt
                                            last edited by lavolp3

                                            This post is deleted!
                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 3 / 5
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy