Skip to content

Commit ab15352

Browse files
Update README.md
Info for using privileged ports
1 parent bc7abdc commit ab15352

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ The modbus registers are mapped to shared memory objects:
3939
AI | Discrete Input Registers | read-only | <name-prefix>AI
4040
```
4141

42+
### Use privileged ports
43+
The standard modbus port (502) can be used only by the root user under linux by default.
44+
To circumvent this, you can create an entry in the iptables that redirects packets on the standard modbus port to a higher port.
45+
The following example redirects packets from port 502 (standard modbus port) to port 5020
46+
```
47+
iptables -A PREROUTING -t nat -p tcp --dport 502 -j REDIRECT --to-port 5020
48+
```
49+
The modbus client must be called with the option ```-p 5020```
50+
4251
## Libraries
4352
This application uses the following libraries:
4453
- cxxopts by jarro2783 (https://github.com/jarro2783/cxxopts)

0 commit comments

Comments
 (0)