• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    SNMP trap receiving - iptables

    User help
    2
    4
    875
    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.
    • SwinoS
      Swino
      last edited by Swino

      I am running mango version 4.0.0 and trying to get SNMP traps working. I have added a rule to iptables to forward snmp traps from port 162 to 1162 using this command. I have changed my data source to look for traps on port 1162.

      iptables -t nat -A PREROUTING -i eth0 -p udp --dport 162 -j REDIRECT --to-port 1162
      iptables -I INPUT -p udp --destination-port 162 -j ACCEPT

      When run the iptables list I get this

      899a82ee-48a9-4c8d-84b3-73d5d1b0a040-image.png

      when I run netstat I can see that port 1162 is bound to java so that all looks good

      9b7ae692-aa7f-4d19-8f5a-43c546f8f87e-image.png

      So I think the issue might be with my understanding of the iptables rule. Is the above iptables rule correct?

      I have used wireshark to packet sniff my trap sender, the traps are definitely being generated.
      0ce1416b-7b76-4887-8915-16b640829fbb-image.png

      In mango how can I check if the traps are being received in the application apart from looking at the data point in the data source?

      My test device is a router and I am monitoring a spare ethernet port for UP/DOWN status. only the get requests are updating the port status. The trap generation has no effect on the data point.

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by MattFox

        Try

        iptables -t nat -A PREROUTING -p UDP -i eth0 -d 127.0.0.1 --dport 162 -j DNAT --to-destination 127.0.0.1:1162
        

        you may need to change the -d property to match the destination ip sent by your snmp device. Just a shot in the dark here, been a while since I have used ip tables...

        Fox

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • SwinoS
          Swino
          last edited by

          @mattfox said in SNMP trap receiving - iptables:

          iptables -t nat -A PREROUTING -p UDP -i eth0 -d 127.0.0.1 --dport 162 -j DNAT --to-destination 127.0.0.1:1162

          Hi Matt is there anyway to packet sniff the data in Mango? The only way I am testing this at the moment is looking at the data point in the watch list or the data point in the data source. Are there any tools for seeing if the UDP packets are making it into Mango?

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by MattFox

            Run wireshark on the mango unit.

            sudo apt-get install wireshark

            Also turn on logging on the datasource if it has it

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            1 Reply Last reply Reply Quote 0
            • First post
              Last post