Difference between revisions of "Modbus TCP Port"
From Proview Wiki
(Created page with "<p>In a Linux system only root can bind a port < 1024. <br /> As for Modbus TCP the standard port is 502.<br /> In this case you will get the next failure at runtime start-...") |
|||
Line 1: | Line 1: | ||
− | + | In a Linux system only root can bind a port < 1024. <br /> | |
− | < | + | As for Modbus TCP the standard port is 502.<br /> |
− | + | In this case you will get the next failure at runtime start-up: "Modbus TCP Bind socket failure, retrying...Permission denied"<br /> | |
− | + | <br /> | |
− | + | ||
− | + | * Change the port to a port number > 1024 | |
− | + | or | |
− | + | * Set the s-bit on the plc-executable (note: if you rebuild do this again on the new plc-executable) | |
− | + | <br /> | |
+ | If you are running a firewall: The following commands opens this port:<br /> | ||
+ | |||
+ | |||
+ | sudo iptables -A INPUT -p tcp --dport 502 -j ACCEPT<br /> | ||
+ | <br /> | ||
+ | sudo iptables -A OUTPUT -p tcp --dport 502 -j ACCEPT<br /> | ||
+ | <br /> | ||
+ | |||
+ | TBD:<br /> | ||
+ | |||
+ | sudo sh -c "iptables-save > /etc/iptables.rules" |
Latest revision as of 03:51, 27 August 2013
In a Linux system only root can bind a port < 1024.
As for Modbus TCP the standard port is 502.
In this case you will get the next failure at runtime start-up: "Modbus TCP Bind socket failure, retrying...Permission denied"
- Change the port to a port number > 1024
or
- Set the s-bit on the plc-executable (note: if you rebuild do this again on the new plc-executable)
If you are running a firewall: The following commands opens this port:
sudo iptables -A INPUT -p tcp --dport 502 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 502 -j ACCEPT
TBD:
sudo sh -c "iptables-save > /etc/iptables.rules"