99% of the time you can just use the local address to talk to yourself. This is just an example to show you how wrangle the ip address using awk. Rewrite the hosts file so the host itself can use it’s external address by name. Write out the basic stuff in hosts that doesn’t change then write out the current IP address.
See current network properties for all interfaces, Manually configure an IP address for interface eth0, See the current network properties for all wireless interfaces, Configure wireless to talk to a specific access point by address, Configure a wireless interface to use channel 11, Set the default gateway, Configure static routes, See what PIDs/processes are associated with remote connections
Here’s a bunch of ways to get the ip addresses for all your network interfaces using ifconfig.