If we are using a Modicon M221 that has an ethernet port then in the software EcoStruxure Machine Expert Basic we can configure the ethernet setting (ETH1) on the "Configuration" tab:
In the setting we have four (4) "Security Parameters" and each of them use specific ports when they are enabled:
•The "Programming Protocol" when it is enabled it uses the TCP port 502.
•The "EtherNet/IP protocol" when it is enabled it uses the TCP port 44818 and UDP port 2222.
•The "Modbus Server" when it is enabled it uses the TCP port 502.
•The "Auto discovery protocol" when it is enabled it uses the UDP ports 27126-27127.