On a machine that has multiple network interfaces, where more than one interface can be used to reach a given peer (or the Internet), the InterfacePeers option can be used instead of the Peers option to create peerings over specific interfaces.
It is possible to connect to the same peer multiple times using different interfaces, creating a highly-available peering configuration.
Like in the above multi-homed example, the machine may have two or more network interfaces. An example may be a Wi-Fi interface and a wired ethernet interface. If you want to accept incoming peering connections on both, but to specifically prefer sending traffic over one or other link whenever possible, you can use the priority field in the peering URI.
Lower numbers are better. In this example, peerings to the priority 1 peering port will be used whenever possible, therefore if another node peers to both interfaces, the wired peering will be preferred over wireless one:
Note that the priority field only influences traffic between two peerings to the same node. It does not affect routing decisions across different nodes.
If like above you have multiple network interfaces but are using multicast peers, but want to prefer one network interface over the other, you can specify the Priority for a given multicast interface.
Lower numbers are better. In this example, peerings that are automatically discovered and established over eth0 will be preferred over peerings to the same node made over eth1.
If your device has a firewall enabled, multicast discovery of peers through MulticastInterfaces may not work by default. To get this to work, perform the following three steps:
MulticastInterfaces, set Port to a fixed TCP port numberff02::114) through your firewallFor basic peering setup, see the Configuration Guide.