Categories
Software SysAdmin

Setting NIC IP addresses as environment variables

An easy and reliable method for applying your NIC IP addresses to your environment and scripts.

Conclusion

You are now able to use variables that represent the IP address of each of your system’s NICs. As you see with the Dependencies example in this article, you can quickly bind a service to an interface’s address, regardless of its IP address state as static or dynamic.

To expand upon real-world use cases of this example: when I want a containerized service to bind to VPN connections, I use ${TUN0_IPV4} in place of the ${DEFAULT_IPV4} parameter.

See also

External links

Leave a Reply

Your email address will not be published. Required fields are marked *