CentOS 7 Run Script When Network Interface is Up (Network Manager)

Originally published at: https://www.cyberciti.biz/faq/centos-7-run-script-when-network-interface-is-up-network-manager/

I want to run a shell script or other program immediately after my network interface goes up on a CentOS 7 / RHEL 7 server. I created /sbin/ifup-local, but it is not working on a CentOS 7 box but works perfectly on CentOS 6. I am using NetworkManager with CentOS 7. How do I run ifup-post or ifup-pre scripts?