what is my real address?

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Mar 3 05:13:49 PST 2004


On Wed, Mar 03, 2004 at 06:15:51PM +0800, Robert Storey wrote:
> I've set up a FreeBSD client at our school. The client gets its address
> via dhcp from the gateway machine which runs Windows NT (yuch!). There
> is apparently a proxy server installed which blocks http, but I can get
> out onto the Internet using ssh to login to another server, from where I
> run lynx if I want to visit web sites. ftp is not blocked, so I can
> download if I need to.

If you need to find your external address quickly, then ssh into this
other machine and look at the variables that ssh sets in your
environment -- I'm assuming that the box you ssh into is running some
variety of OpenSSH. eg:

    % env | grep SSH
    SSH_CLIENT=81.2.69.219 1483 22
    SSH_CONNECTION=81.2.69.219 1483 81.2.69.219 22
    SSH_TTY=/dev/ttyp4
    SSH_AUTH_SOCK=/tmp/ssh-6kfGMKtW/agent.30744

where you can see I ssh'd from 81.2.69.219 to 81.2.69.219 (yes --
pretty pointless, but this is just for illustration).
 
> For run, I would like to run an ftp server on this client machine. For
> that, I would need to know my real address on the web, but I am not sure
> how to find this info. If I run ifconfig, it tells me the following:
> 
>   inet addr: 10.0.0.10
>   Bcast: 10.0.0.31
>   Mask 255.255.255.224

Running an FTP server through a NAT'ing gateway is not going to be a
pleasant experience, even if you were running the NAT gateway on a
FreeBSD box where natd's punch_fw functionality would make things a
great deal easier for you.  FTP is an ancient protocol not designed to
cope with the realities of the modern internet.

You'ld be better off putting a reverse-proxy on your gateway machine.

> A related question...I do realize that my address could change everytime
> I fire up the client machine. I'm wondering if I can deal with that by
> using dyndns? Remember, this would be for an anonymous ftp server, not
> http.

There are several ports in the ports collection that do this sort of
thing -- updating a DNS server when your IP nuber allocation changes
so your registered domains resolve to the right place.  Usually they
work by querying your ADSL router or Cable modem every so often as to
what its IP addresses are.  If the gateway machine supports SNMP, you
might be able to adapt some of those scripts to work using that.  I
can remember off-hand exactly what SNMP oid you need to query to find
out the interface address, but it should work pretty well: mrtg(1)
does that sort of thing against all sorts of hardware.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040303/b9a6c5c7/attachment.bin


More information about the freebsd-questions mailing list