From owner-freebsd-net@FreeBSD.ORG Sun Aug 15 12:43:25 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1BB1065697 for ; Sun, 15 Aug 2010 12:43:25 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 6A29B8FC0C for ; Sun, 15 Aug 2010 12:43:25 +0000 (UTC) Received: from park.js.berklix.net (p549A2FAC.dip.t-dialin.net [84.154.47.172]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id o7FChMxK005723; Sun, 15 Aug 2010 12:43:23 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id o7FChCM2022223; Sun, 15 Aug 2010 14:43:12 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id o7FCgvC7011391; Sun, 15 Aug 2010 14:43:02 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201008151243.o7FCgvC7011391@fire.js.berklix.net> To: =?UTF-8?Q?I=C3=B1igo_Ortiz_de_Urbina?= From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Sun, 15 Aug 2010 13:44:55 +0200." Date: Sun, 15 Aug 2010 14:42:57 +0200 Sender: jhs@berklix.com Cc: FreeBSD Net , Zeus V Panchenko Subject: Re: startup network configuration choice X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2010 12:43:25 -0000 =?UTF-8?Q?I=C3=B1igo_Ortiz_de_Urbina?= wrote: > Maybe you could glue some ifstated magic to your script. > > I heard suggestions like this some time ago on a different list, > anyway, I have never tried it myself as running a script to setup my > network manually is not inconvenient, after all, I do startx myself > everytime I boot the computer :) Personally I have this in /etc/rc.conf, host="mylap" ; domain="company.com" host="mylap" ; domain="no.net" host="mylap" ; domain="home.net" hostname="$host.$domain" case $hostname in #{ "mylap.home.net") #{ ifconfig_fxp0="inet 192.168.10.11" # whatever other things too ;; "mylap.company.com") ifconfig_fxp0="inet 10...... ;; ifco........ "mylap.no.net") ;; esac Before I shut down to leave, I edit it, moving destination domain to last in list. What I should do is eg: ping -c 1 some_known_site_dependent_host or better still set up dhcpd hosts, & let the laptop search for site dependent dhcpd servers. > If you get anywhere, posting your findings would be helpful and > healthy for the archives The topic has been discussed numerous times over years on mobile@freebsd.org, I think it better the topic stays there than on net@ :-) so search the mobile@ archives ( net@ seems more appropriate for somewhat deeper stuff, if eg DHCPD fails to negotiate or whatever. ) > > On 8/15/10, Zeus V Panchenko wrote: > > Hi All, > > > > may somebody advice, please ... > > > > i'd like to get automatic network configuration for my netbook while > > startup depending on the network it connected to while starting up ... > > > > not dhcp, but system startup script to detect the network and to > > configure the interfaces > > > > i have written script which receives arguments -h for home and -j for > > job and cosequently configures network, and configured network in > > rc.conf for one of the connections (default is job) > > > > but i'd like the system to do that automaticaly to avoid timeouts of > > network services like sshd/sendmail/e.t.c. when i'm starting up with > > "wrong" connection > > > > is there correct way to do that with some of the sturtup scripts or i > > have to do that by hands somewhere in rc.early? > > > > -- > > Zeus V. Panchenko > > IT Dpt., IBS ltd GMT+2 (EET) > > _______________________________________________ > > freebsd-net@freebsd.org mailing list Cheers, Julian -- Julian Stacey: BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text, Not HTML, quoted-printable & base 64 dumped with spam. Avoid top posting, It cripples itemised cumulative responses.