Mail Archives: cygwin/2004/04/21/16:46:14
> The ipconfig stuff isn't much more reliable, depending on your setup.
> I always have TWO IP's when my PPP/ISDN is up:
>
> $ ipconfig /all
You could try using the "route print" command as well. i.e. Maybe something
like:
route print |expand |sed -n -e "s,.* $(route print|expand|sed -n -e
's,[.],[.],g' -e 's,^Default Gateway: *,,p') *\([0-9][0-9.]*\)
*[0-9][0-9]*,\\1,p"
But if you are behind a NAT, that probably won't give you what you really
want either...
A more elegant solution is to use dynamic dns. For example I use the
following script run from my crontab:
#!/bin/sh
cd /tmp;exec wget --delete-after
http://freedns.afraid.org/dynamic/update.php?KSD1ADSFLIjkseS11Dc=
This automatically updates a dynamic DNS on afraid.org. Then even when I'm
connected via WIFI across two separate NAT routers, I can still use my
dynamic DNS name.
Bill
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -