Network Environments

For running Consul we should have at least one network adapter besides the loopback interface. Consul prefers private IP addresses (as defined in RFC 1918) for communication by default.

If your machine has only a loopback interface, Consul will start but it will not be a part of any cluster.

Based on the available network adapters and the type of network (public/private) that they are connected to, Consul behaviour will vary and the appropriate configuration in each case is different.

The possible cases are

  • Single IP Address, private range
  • Single IP Address, public range
  • Multiple IP Addresses, 0 private, 2 or more public
  • Multiple IP Addresses, 1 private, 1 or more public
  • Multiple IP Addresses, 2 private, others (or none) public

A summary of Consul's behavior in these situations follows

  • Consul prefers private IP addresses by default, if there is only one, no configuration is required.
  • In the case of multiple private IP addresses, Consul won't start as it does not choose any of them by itself, and specific configuration is required.
  • In case the machine has public IP addresses only, specific configuration is required.
  • The relevant configuration parameters are bind_addr & advertise_addr

We'll cover all the different combinations in this chapter.

results matching ""

    No results matching ""