[WHEREAMI] Re: Help whereami please....

Andrew McMillan andrew at catalyst.net.nz
Fri Oct 21 10:23:27 NZDT 2005


On Thu, 2005-10-20 at 14:59 +0200, bozzo at mporzio.astro.it wrote:
> 
> hello,
> I'm Enrico, and I've wrote to you some mounth ago about a problem with whereami
> I cannot solve.
> I've configured my eth0 card in /etc/network interfaces with this lines:
> 
> auto eth0
> iface eth0 inet static
>     name Ethernet LAN card
>     address 168.254.226.19
>     netmask 255.255.0.0
> 
> wich is a generic ip address.

In general, if you are using whereami, you should not have any stanza
in /etc/network/interfaces related to the interfaces that whereami is
going to control.

This would normally mean that the /etc/network/interfaces file only
contains a stanza for the loopback interface.


> In detect.conf I've this simple configuration:
> 
> ...
> # Test for the presence of an ethernet connection plugged into eth0
> testmii eth0 lan
> 
> 
> # 'down' might be a location that is forced from the command line
> # like "whereami down"
> if down
>   always at undocked
>   always notat eth0,eth1
> elif stop
>   # Or maybe we can't remember the exact command, so we do it twice!
>   # like "whereami stop" this time
>   always at undocked
>   always notat eth0,eth1
> elif lan
>   # If the testmii at the top was successful
>   set INTERFACE eth0
>     testping    192.156.213.6                   osservatorio
>     testpppoe   eth0                             ADSL   
>     testdhcp    '*.*.*.*'                        university
> else
>   # If the testmii at the top failed
>     at home
> fi
> 
> 
> now the problem is that if I keep this configuration whereami always choose the
> 'osservatorio' location, but now for example I'm at 'university' and thereis no
> pc with the ip address 192.156.213.6 (if I give the command 'ping 192.156.213.6'
> it returns with 100% packet lost).
> It seems to me the testping is not taken into consideration.

testping needs more parameters.  Possibly this is a bug in testping
(that it does bad things when you only hand it a single IP) but it
should really be used as follows (from the detect.conf manpage):

testping [interface,]ip_to_ping,ip_to_use
      Uses the fping program to perform a fast ping to look for
      the presence of a particular host on the local network.

So you should be using something like:

  testping 192.156.213.6,192.156.213.101

(assuming that 192.156.213.101 is not going to collide with some other
pre-existing address on that network).

The reason it is done this way is that the second address will remain
assigned to the interface if the test is successful, so that will be
your IP address after whereami has finished...


> If in fact I re-write detect.conf exchanching the two lines:
> 
> set INTERFACE eth0
>     testpppoe   eth0                             ADSL   
>     testdhcp    '*.*.*.*'                        university
>     testping    192.156.213.6             osservatorio
> 
> at boot it always tries to obtain dhcp and do not search for the ip address.

Normally you would do slightly differently (where you access multiple
DHCP servers):

  ...
elif lan
    testdhcp    '*.*.*.*'                        dhcp
    testping    192.156.213.6             osservatorio
fi

if dhcp
    testdhcp    '172.17.25.*'             university
    testdhcp    '10.27.19.*'              erewhon
else
endif


Other than that what you are doing looks OK.  I'm not familiar with the
testpppoe really, as pppoe is extremely rare in New Zealand (DSL here is
almost invariably provided as ppp over ATM).

> Have I done something wrong?
> There is something else I can verify?
> 
> It is really important for me!
> Thank you very much in advance!!!

I hope this is some help.

Regards,
					Andrew McMillan.

-------------------------------------------------------------------------
Andrew @ Catalyst .Net .NZ  Ltd,  PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/            PHYS: Level 2, 150-154 Willis St
DDI: +64(4)803-2201      MOB: +64(272)DEBIAN      OFFICE: +64(4)499-2267
           May you have many beautiful and obedient daughters.
-------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.catalyst.net.nz/pipermail/whereami-discuss/attachments/20051021/fb376268/attachment.pgp


More information about the whereami-discuss mailing list