Re: finding nat'd IP address?

2007-04-10 Thread Benjamin Lutz
On Tuesday 10 April 2007 05:32, Chandhee Thala wrote:
 if i connect to the net with a cable modem or some other device that
 uses NAT and gives me a private IP addresses, what is the most
 Elegant way to get my real IP? (assume that the device itself will
 not let me have it).

 I can go to some site that gives the visitor their ip address and
 screen scrape, but I'd like to know if there is a cleaner solution
 before I start scripting.

Nope, that's the way to go. I'd deposite some very small cgi-bin on some 
webserver, eg this one:

#!/usr/bin/perl
print Content-type: text/plain\n\n;
print $ENV{REMOTE_ADDR};

Cheers
Benjamin


pgpPKvJIbRJmZ.pgp
Description: PGP signature


finding nat'd IP address?

2007-04-09 Thread Chandhee Thala

if i connect to the net with a cable modem or some other device that uses
NAT and gives me a private IP addresses, what is the most Elegant way to
get my real IP? (assume that the device itself will not let me have it).

I can go to some site that gives the visitor their ip address and screen
scrape, but I'd like to know if there is a cleaner solution before I start
scripting.

thanks
c
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding nat'd IP address?

2007-04-09 Thread Bill Campbell
On Mon, Apr 09, 2007, Chandhee Thala wrote:
if i connect to the net with a cable modem or some other device that uses
NAT and gives me a private IP addresses, what is the most Elegant way to
get my real IP? (assume that the device itself will not let me have it).

I can go to some site that gives the visitor their ip address and screen
scrape, but I'd like to know if there is a cleaner solution before I start
scripting.

The ``ifconfig'' command will show the information for one or all
NICs on the system including the private IP address assigned.

Checking on an external site will only show you the public IP
address of the box doing NAT.  We have a utility to do this:

http://www.celestial.com/showinfo_form

Bill
--
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

The Constitution is a written instrument.  As such, its meaning
does not alter.  That which it meant when it was adopted, it
means now.
-- SOUTH CAROLINA v. US, 199 U.S. 437, 448 (1905)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


finding the ip address

2004-08-29 Thread Steven Friedrich
I'm messing with ubermon for superkaramba and I want to know how to get my 
hosts ip address from the command line (and only the ip address).

I know I can grep and sed rc.conf or the output of ifconfig, but I'm hoping 
there's a command like whoami for the ip address.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Matt Emmerton
 I'm messing with ubermon for superkaramba and I want to know how to get my
 hosts ip address from the command line (and only the ip address).

 I know I can grep and sed rc.conf or the output of ifconfig, but I'm
hoping
 there's a command like whoami for the ip address.

There isn't anything that simple, but munging the output of ifconfig is what
you want.  This assumes that your box only has one IP address (other than
localhost):

# ifconfig -a | grep inet  | grep -v 127.0.0.1 | awk ' { print $2 } '
192.168.0.4

--
Matt Emmerton

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Kevin D. Kinsey, DaleCo, S.P.
Matt Emmerton wrote:
I'm messing with ubermon for superkaramba and I want to know how to get my
hosts ip address from the command line (and only the ip address).
I know I can grep and sed rc.conf or the output of ifconfig, but I'm
   

hoping
 

there's a command like whoami for the ip address.
   

There isn't anything that simple, but munging the output of ifconfig is what
you want.  This assumes that your box only has one IP address (other than
localhost):
# ifconfig -a | grep inet  | grep -v 127.0.0.1 | awk ' { print $2 } '
192.168.0.4
--
Matt Emmerton
 

But, for simplicity, if you are on a public host:
$host `hostname`
might do it...
KDK
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Steven Friedrich
On Sunday 29 August 2004 04:04 pm, Matt Emmerton wrote:
  I'm messing with ubermon for superkaramba and I want to know how to get
  my hosts ip address from the command line (and only the ip address).
 
  I know I can grep and sed rc.conf or the output of ifconfig, but I'm

 hoping

  there's a command like whoami for the ip address.

 There isn't anything that simple, but munging the output of ifconfig is
 what you want.  This assumes that your box only has one IP address (other
 than localhost):

 # ifconfig -a | grep inet  | grep -v 127.0.0.1 | awk ' { print $2 } '
 192.168.0.4

 --
 Matt Emmerton

 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]

Thanks for the info.

I modifies your solution slightly, so I could use it for more interfaces 
easily.

ifconfig dc0 | grep inet|awk '{print $2}'
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Kevin D. Kinsey, DaleCo, S.P.
Kevin D. Kinsey, DaleCo, S.P. wrote:
Matt Emmerton wrote:
I'm messing with ubermon for superkaramba and I want to know how to 
get my
hosts ip address from the command line (and only the ip address).

I know I can grep and sed rc.conf or the output of ifconfig, but I'm 
hoping

there's a command like whoami for the ip address.
  

There isn't anything that simple, but munging the output of ifconfig 
is what
you want.  This assumes that your box only has one IP address (other 
than
localhost):

# ifconfig -a | grep inet  | grep -v 127.0.0.1 | awk ' { print $2 } '
192.168.0.4
--
Matt Emmerton
 

But, for simplicity, if you are on a public host:
$host `hostname`
might do it...
KDK
Doh!  You'd still have to deal with some text output,
though.  Sorry.
KDK
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Wojciech Puchar

 I modifies your solution slightly, so I could use it for more interfaces
 easily.

 ifconfig dc0 | grep inet|awk '{print $2}'
 ___

if your host use DHCP - you may add something to your dhclient.conf and
make some script to record it's IP.


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: finding the ip address

2004-08-29 Thread Wojciech Puchar
 
 Doh!  You'd still have to deal with some text output,
 though.  Sorry.

 KDK

host -t A `hostname`|head -1|cut -f 4 -d  

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]