Matej Cepl wrote: > > Realistically I think the best way would be to run whereami > > in the up/down hooks with --hint options used to restrict > > the detection rulesets. > > I have created these two scripts (saved to /etc/ppp/ip-up.d/ > and /etc/ppp/ip-down.d/ respectively) and all seems to be well.
Take back -- it doesn't work. I do not know why, but after running whereami with attached configuration files ping (or dig, host, fping, whichever of them) is not able to make Internet name resolution (from smtp.surfbest.net to 216.127.146.11). Do you have any idea, what may be the reason? Matej -- Matej Cepl, Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC 138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488 [W]hat country can preserve its liberties, if its rulers are not warned from time to time that [the] people preserve the spirit of resistance? Let them take arms...The tree of liberty must be refreshed from time to time, with the blood of patriots and tyrants. -- Thomas Jefferson, letter to Col. William S. Smith, 1787
# # # # Sample configuration file for 'whereami' copyright Andrew McMillan, 1999 # # # Surfbest =surfbest setmailrelay smtp.surfbest.net #+surfbest setresolver search surfbest.net # tohle je nastavení, které doporučuje www.surfbest.net pro MAC OS7 #=surfbest setresolver search surfbest.net nameserver 209.63.0.2 nameserver 207.173.86.2 # Volný.cz =volny setmailrelay smtp.volny.cz =volny setresolver search volny.cz nameserver 212.20.96.34 nameserver 212.20.96.38 # NEU =neu setmailrelay smtp.neu.edu =neu setresolver search neu.edu nameserver 129.10.1.49 nameserver 155.33.33.62 =neu route add -host 127.0.0.1 lo # Doma +home setresolver +home setmailrelay queue smtp.surfbest.net +home /etc/init.d/nfs-kernel-server start -home /etc/init.d/nfs-kernel-server stop =unknown setmailrelay queue
# The (planned) detection configuration file for 'whereami' # $Id: detect.conf,v 1.3 2003/02/21 19:09:15 root Exp $ # # This file describes unique features of various environments you connect # to and associates them with those locations. # When a test is successful, no further tests will be conducted # until a subsequent 'if' or 'fi' statement, or if the line is preceded # by the word 'always' # # You may also set environment variables for the scripts (test and action) # subsequently called by whereami using "set <varname> <value>". # # See man 5 detect.conf for more information. # The entries below are examples only - you will need to add your own set DEBUGWHEREAMI 1 default unknown testmii eth0 lan # always testpci Lucent bogus1 # always testpci CMD docked,office if lan set INTERFACE eth0 testdhcp '*.*.*.*' dhcp testping 192.168.0.3 home else #testmodule ppp_deflate ppp fi if dhcp #testdhcp 192.10.*.* neu testping 192.10.244.11 neu #testdhcp 192.* mit fi if ppp set INTERFACE ppp0 # testing DNS server testping 198.6.1.6 surfbest #testping 198.6.1.6 volny fi
#!/bin/sh -e PATH=/bin:/sbin:/usr/bin:/usr/sbin # If ppp option is not there, don't do anything here. if ! [ -f /etc/whereami/whereami.conf ]; then exit 0 fi /usr/sbin/whereami --hint ppp