Thus said Gabriel Gunderson on Mon, 23 Sep 2013 15:35:51 -0600: > In most cases, if you're getting IPs via DHCP, you're likely also > behind a NAT (at least in most small office / home setups). In which > case, `curl icanhazip.com` or whatever will work, but it will give you > the public IP being used at your gateway.
Something that might be a little more simple to parse and which will work reliably behind NAT or even if your machine has a public IP: $ tcpclient -T 10 -RHl 0 www.google.com 80 /bin/sh -c 'echo $TCPLOCALIP' 172.31.45.103 Andy -- TAI64 timestamp: 4000000052410369 /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
