From owner-freebsd-net@FreeBSD.ORG Thu Feb 23 13:29:18 2006 Return-Path: X-Original-To: freebsd-net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4E3416A420 for ; Thu, 23 Feb 2006 13:29:17 +0000 (GMT) (envelope-from subscriber@osk.com.ua) Received: from gandalf.osk.com.ua (osk.com.ua [195.5.17.76]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95C4B43D46 for ; Thu, 23 Feb 2006 13:29:16 +0000 (GMT) (envelope-from subscriber@osk.com.ua) Received: from localhost (localhost [127.0.0.1]) by gandalf.osk.com.ua (Postfix) with ESMTP id 732A578C21 for ; Thu, 23 Feb 2006 15:34:39 +0200 (EET) Received: from gandalf.osk.com.ua ([127.0.0.1]) by localhost (gandalf.osk.com.ua [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 65869-12; Thu, 23 Feb 2006 15:34:38 +0200 (EET) Received: from OLEG (unknown [192.168.82.111]) by gandalf.osk.com.ua (Postfix) with ESMTP id A86FB78C1C; Thu, 23 Feb 2006 15:34:38 +0200 (EET) Date: Thu, 23 Feb 2006 15:29:13 +0200 From: Oleg Tarasov X-Mailer: The Bat! (v3.64.01 Christmas Edition) Professional X-Priority: 3 (Normal) Message-ID: <648510709.20060223152913@osk.com.ua> To: FreeBSD MailList In-Reply-To: <1775760256.20060223143441@osk.com.ua> References: <1775760256.20060223143441@osk.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at osk.com.ua Cc: freebsd-net@FreeBSD.org Subject: Re: ifstated fails to monitor netgraph interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD MailList List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2006 13:29:18 -0000 Hello, I have found a solution to see ng0 state but using external test. Everything would be fine but there are 2 difficulties: 1) for some reason when in state "secondary" only one external test is run (viewing logfile at debug loglevel) 2) Second (PPPoE) connection can disappear for a short period of time destroying default route but it won't trigger state change as the periodic test can miss this. What can be the source of 1) ? Commenting second "if" statement in "secondary" state makes first test run. Other way only second is run after 1 first test execution. My ifstated.conf =========================================================== init-state auto loglevel debug pri_iface_up = '"ping -q -c 1 -t 1 111.111.111.111 > /dev/null" every 5' sec_iface_up = '"ifconfig ng0 | grep UP > /dev/null" every 2' #sec_iface_up = '"ping -q -c 1 -t 1 222.222.222.222 > /dev/null" every 10' #sec_iface_up = "ng0.link.up" state auto { if $pri_iface_up set-state primary if $sec_iface_up set-state secondary } state primary { init { run "route delete default" run "route add default 111.111.111.111" run "sleep 20" } if ! $pri_iface_up set-state primary_failing } state primary_failing { init { run "sleep 10" } if $pri_iface_up set-state primary if ! $pri_iface_up && $sec_iface_up set-state secondary if ! $pri_iface_up && ! $sec_iface_up set-state secondary } state secondary { init { run "route delete default" run "route add default 222.222.222.222" run "sleep 20" } if $pri_iface_up set-state primary if ! $sec_iface_up set-state auto } ========================================================== Initially primary router is down ifstated.log ========================================================== ifstated: initial state: auto ifstated: changing state to auto ifstated: running ping -q -c 1 -t 1 111.111.111.111 > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: started ifstated: changing state to secondary ifstated: running ping -q -c 1 -t 1 111.111.111.111 > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running route delete default delete net default ifstated: running route add default 222.222.222.222 add net default: gateway 222.222.222.222 ifstated: running sleep 20 ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ifstated: running ifconfig ng0 | grep UP > /dev/null ========================================================== -- Best regards, Oleg Tarasov mailto:subscriber@osk.com.ua