Do I need to set the max. participant index in the peers list?

Note: Relevant RTI Connext versions: RTI Connext 4.x and above.

The Maximum Participant Index is an optional value at the beginning of a Peer Descriptor. It is used to specify a range of ports where RTI Connext will look for other participants during the discovery process. It tells RTI Connext how many participants it should expect to find on a particular host.

You can set it through the NDDS_DISCOVERY_PEERS environment variable, a file named NDDS_DISCOVERY_PEERS, through DDS_DomainParticipantQoS.discovery.initial_peers, or using an XML QoS profile. For additional details refer to Solution How do I set the initial peers and multicast receive address programmatically or via XML?

Using Unicast

5@localhost   // 6 participants (0-5) on localhost
3@ // 4 participants (0-3) on 
Since the default max_participant_index is 4, you don't have to set it unless there are more than 5 participants running on a host.

Using Multicast

If you have a large number of machines trying to discover each other, you might consider using multicast discovery instead of listing all of their IP addresses and setting the max_participant_index. The port number used for multicast is determined by the domain ID; therefore it is not necessary to specify the participant index to calculate the port number if a multicast address is used. 
If you decide to explore this route, please pay careful attention to the organization of the machines and multicast addresses, in order to avoid the situation where a machine is listening on too many multicast addresses and goes into promiscuous mode. Promiscuous mode is a special mode of the network adapter in which all traffic (physical addresses, broadcast addresses or bound multicast addresses) is passed up to the operating system, rather than just packets addressed to it. This will obviously affect performance. 

Note: In 4.2b and older releases, the "participant ID" was known as the "participant index".