Enable port
![]() | Automatic port enabling for TwinCAT Functions Ports that are required for TwinCAT Functions are automatically enabled once the TwinCAT Functions have been installed. |
This step shows how to enable a TCP port. As an example, an incoming connection is created for TCP port 502, which is required for Modbus/TCP communication.
Enable a port as follows:
- 1. Enter the command
doas ee /etc/pf.confon the console.
Thepf.confconfiguration file is opened. - 2. Create the
pass in quick proto tcp to port 502 keep staterule to enable TCP port 502. - 3. Press [Esc] and save the changes.
- 4. Enter the command
doas pfctl -f /etc/pf.confto reload the rules. The firewall must be activated for this.
- You have successfully enabled a port. Use the command
doas pfctl -f /etc/pf.confto enable the rules immediately. Otherwise, the rule takes effect after the next firewall restart.
