Linux-HA Logo

Heartbeat IPaddr2 resource agent

The IPaddr2 resource agent[1] is used by Heartbeat[2] to configure IPv4 ServiceAddress[3]es. Most resource groups[4] will contain at least one IPaddr2[5] or IPaddr[6] resource agent.

The basic syntax of an IPaddr2 resource is

  IPaddr2::ip-address[/netmask[/interface][/broadcast]]

So, the following forms of addressing are legal:

  IPaddr2::address
  IPaddr2::address/netmask
  IPaddr2::address/netmask/broadcast
  IPaddr2::address/netmask/interface
  IPaddr2::address/netmask/interface/broadcast

By far the most common case is the simplest one:

  IPaddr2::ip-address

In this form, appropriate defaults are taken as described below.

Default Interface

If the interface was omitted, we use the system routing tables to determine which interface would be used to route a packet to the given address. That is, IPaddr2 selects the preferred interface for sending packets to that subnet. If no such interface can be found, heartbeat will issue a message something like this:

ERROR: unable to find an interface for given-ip-address

Default netmask

If the CIDR netmask is omitted, we choose the netmask associated with the route to the subnet to which packets to the given IP address would be routed. That is, we simply look up the routing information for that address, and use it to compute the correct netmask (and other items as described below).

Default broadcast address

If the broadcast address was omitted, IPaddr2[5] defaults to the highest address in the subnet (the usual default).

Examples

  IPaddr2::135.9.216.100
  IPaddr2::135.9.216.100/24                  (implies a 255.255.255.0 netmask)
  IPaddr2::135.9.216.100/24/135.9.216.255
  IPaddr2::135.9.216.100/24/eth0
  IPaddr2::135.9.216.100/24/eth0/135.9.216.255

Special Note

The interface mentioned above does not include an alias number. Heartbeat assigns them dynamically according to the available alias names.

See http://www.doom.net/docs/netmask.html[7] for a table explaining CIDR address format and their relationship to life, the universe and everything.

Unlike IPaddr[6], IPaddr2 has no obvious limitations on the number of addresses it can configure on an interface.

See Also

ResourceAgent[1], HeartbeatResourceAgent[8], IPaddr resource agent[6], Linux Hacks article[9] on our send_arp command


References

[1]http://www.linux-ha.org/ResourceAgent
[2]http://www.linux-ha.org/HeartbeatProgram
[3]http://www.linux-ha.org/ServiceAddress
[4]http://www.linux-ha.org/ResourceGroup
[5]http://www.linux-ha.org/HeartbeatResourceAgent/IPaddr2
[6]http://www.linux-ha.org/HeartbeatResourceAgent/IPaddr
[7]http://www.doom.net/docs/netmask.html
[8]http://www.linux-ha.org/HeartbeatResourceAgent
[9]http://www.onlamp.com/pub/a/onlamp/2003/04/03/linuxhacks.html


This information provided courtesy of the Linux-HA project at http://linux-ha.org/