=================
CPE NAT IP hooks
=================

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

After a CPE NAT 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/cpenatip.d/all``: hooks to be run for all CPE NAT IP
-  ``/etc/bonding/cpenatip.d/<CPE NAT IP ID>``: hooks for individual CPE
   NAT IPs
-  ``/etc/bonding/cpenatip.d/default``: hooks for CPE NAT IPs with no
   individual hook folder

An example CPE NAT IP hook is available at
``/usr/share/doc/bonding/examples/cpenatip-hook``.

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

CPE NAT IP hooks are run with the following environment variables:

-  ID: the CPE NAT IP ID
-  BOND_ID: the ID of the CPE NAT IP's bond
-  IP: the IP address
-  DEST_NAT_IP: The NAT IP address
-  DEST_NAT_NETMASK: The NAT IP netmask
