@craigweb said in Modbus Publisher on Port 502:
Do you have a Modbus data source that is bound to 502 as well?
Yes, actually all my data sources are Modbus/TCP on port 502 which I don't have any issue to pull data from them. The only issue is publishing on Mango port 502.
@terrypacker said in Modbus Publisher on Port 502:
@skazemi you have a few options, by default linux restricts access to ports below 1000 (which you have figured out).
I suggest you follow this procedure which will allow Mango to safely run with the proper privileges to access port 502: https://help.infiniteautomation.com/linux-installation
The service is already installed and running on Mango GT and I couldn't find anything which can help with that, except this that I didn't know!!
"Note: Never run Mango as root, this is a security risk and will also result in files in /opt/mango having the incorrect owner."
But for general reference you have other options:
You could use iptables to route traffic between ports. Here is an example of how we route traffic between 8080 <--> 80 https://help.infiniteautomation.com/linux-security
I can't remember if the GT support ipchains but you could try those with something like this
/sbin/ipchains -I input --proto TCP --dport 502 -j REDIRECT 5020
For these two solutions, I need to put the rule somewhere like rc.local to run in startup, however it didn'twork! looks like Mango or something else overwritten the iptables after bootup. I already asked about this in another post, no answer yet:
- You could try
setuid to allow the Mango process to access port 502
Hope that helps.
I'll try this!