Workaround: After MPI is started, add firewall rules to prevent external networks from connecting to the listening ports of mpirun, orted (internal components of MPI), and Ascend DMI. After MPI ends execution, clear the firewall rules.
1 2 3 4 5 6 7 8 | ```shell iptables -D INPUT -p tcp -j ${Rule name} iptables -F ${Rule name} iptables -X ${Rule name} iptables -t filter -N ${Rule name} iptables -I INPUT -p tcp -j ${Rule name} iptables -t filter -I ${Rule name} -i ${NIC to be restricted} -p tcp --dport ${Port to be restricted} -j DROP ``` |
1 2 3 4 | ```shell iptables -D INPUT -p tcp -j ${Rule name} iptables -F ${Rule name} iptables -X ${Rule name} |
1 | btl_tcp_if_include = lo |
You are advised to use MPI only in containers and isolate it by network namespaces. This ensures that no all-zero listening exists on the host and other users of the host cannot connect to the unauthenticated OpenMPI ports.