Currently, there are 0 users and 1 guest visiting this topic .
Viewing 3 reply threads
  • Author
    Posts
    • #8709
      Dmitriy SDmitriy S
      Participant

        If I want to connect external devices, they connect, but do not send logs.
        Perhaps the problem is what is internal address of the mikrowizard server is taken (peer IP). But I didn’t find where this can be changed

        • This topic was modified 3 weeks ago by Dmitriy SDmitriy S.
      • #8711
        Sepehr HashtroudilarSepehr
        Keymaster

          To change peer IP:
          In devices page in front of each device action menu, edit device

        • #8712
          Dmitriy SDmitriy S
          Participant

            Yes, I found this, but there are only 2 options: the local address of the container and the local address of the host.

          • #8713
            Dmitriy SDmitriy S
            Participant

              Issue: Syslog not working for devices behind NAT
              Situation Description:
              MikroWizard server is installed behind a NAT router:

              Server internal IP: 192.168.10.2
              Router external IP: 1.1.1.1
              Client MikroTik devices connect from the internet through the external IP

              Steps to Reproduce:

              Added a MikroTik device to MikroWizard
              Manually configured /system logging on MikroTik with prefix mikrowizard (without ID number)
              Logs were arriving at the server but were not being saved to the database
              Deleted the device and added it again (device ID changed)
              Enabled “Force Syslog” option for automatic configuration
              MikroWizard automatically configured syslog but used the internal address 192.168.10.2 instead of external 1.1.1.1
              Device could not send logs because address 192.168.10.2 is unreachable from the internet

              Issues Found:
              Issue 1: Regex requires device number in prefix

              Code in syslog.py uses regex: mikrowizard(\d+):
              When manually configured, used prefix mikrowizard without number
              Logs were arriving but not being processed (regex didn’t match)
              Solution: Use prefix mikrowizard{device_id}, for example mikrowizard5

              Issue 2: Force Syslog uses peer_ip instead of default_ip

              When “Force Syslog” is enabled, MikroWizard takes peer_ip from the device record
              The peer_ip list only contains IP addresses from the server’s network interfaces
              For a server behind NAT, only the internal IP 192.168.10.2 is available
              The router’s external IP 1.1.1.1 is not available in the list
              Current solution: Add the external IP as an alias on the loopback interface

              Issue 3: Device ID changes when deleted and re-added

              When a device is deleted and re-added, the database ID changes
              Old syslog settings with prefix mikrowizard{old_id} stop working
              Need to either automatically update the prefix or use a different identifier (e.g., by IP address)

              Working Temporary Solution:

              Add external IP as an alias on the server:

              bashsudo ip addr add 1.1.1.1/32 dev lo label lo:ext

              Restart the mikroman container:

              bashsudo docker restart mikroman

              In the MikroWizard web interface, when editing the device, select peer_ip = 1.1.1.1
              Enable “Force Syslog” – now it will use the correct external address

              Improvement Suggestions:

              For servers behind NAT: Add a separate “External IP for Syslog” setting in System Settings, which will be used instead of peer_ip when Force Syslog is enabled
              Simplify prefix: Allow regex to accept both mikrowizard{id}: and just mikrowizard:, identifying the device by sender’s IP address
              Stable identifiers: When deleting/re-adding a device, preserve the ID or use another permanent identifier (MAC address, serial number)
              Automatic availability check: When configuring Force Syslog, check if the specified peer_ip is reachable from the device and warn if not

              • #8719
                Sepehr HashtroudilarSepehr
                Keymaster

                  Hi , thanks for the detailed bug report . that would be prefect if you add it under github issues.
                  For now one way is that you found your self to add dummy IP to linux to trick Mikrowizard as it gets IP list from interfaces and linux .the other workaround is to simply edit the code and add your IP to the list where MikroWizard finds IP list. from linux.

                  I added following to my todo list and feature request with high priority:
                  Add an option to add force custom peer ip.

            Viewing 3 reply threads
            • You must be logged in to reply to this topic.