===================
Connected IP hooks
===================

Connected IP hooks are run with the "start" argument after a connected
IP is added and with the "stop" argument before it is removed.

After a connected IP hook has been added, you must restart the bond from
the management server or from the host command line to execute the hook
the first time.

Hook locations:

-  ``/etc/bonding/connectedip.d/all``: hooks to be run for all connected
   IPs
-  ``/etc/bonding/connectedip.d/<connected IP ID>``: hooks for
   individual connected IPs
-  ``/etc/bonding/connectedip.d/default``: hooks for connected IPs with
   no individual hook folder

An example connected IP hook is available at
``/usr/share/doc/bonding/examples/connectedip-hook``.

Environment variables
----------------------

Connected IP hooks are run with the following environment variables:

-  ID: the connected IP ID
-  BOND_ID: the ID of the connected IP's bond
-  IP: the IP address assigned to the interface
-  NETMASK: the netmask of the IP
-  NETWORK: the network address of the IP/netmask combination
-  INTERFACE: the interface that receives the IP address
-  AGG_ROUTING: string describing aggregator routing mode: one of
   "auto", "always", or "never".

.. note::
    In bonding 6.4, a variable was removed from the environment.
    The following variable is present only in bonding 6.3 and prior:

    -  INTERFACE_MODE: the ethernet mode of the interface the IP as assigned to
