From owner-freebsd-questions@FreeBSD.ORG Tue Mar 29 18:23:19 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 266E9106566B for ; Tue, 29 Mar 2011 18:23:19 +0000 (UTC) (envelope-from jhelfman@experts-exchange.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251]) by mx1.freebsd.org (Postfix) with ESMTP id 01A698FC13 for ; Tue, 29 Mar 2011 18:23:18 +0000 (UTC) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id 9C28874479D; Tue, 29 Mar 2011 11:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=e-e.com; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=ee; t= 1301422998; x=1303237398; bh=lyCejGv3FsMJEhNjA9rWrlwDGpReVJ3z5gg XK5XH1GU=; b=rToG7ao/V5qZrGSEgMDGB2hywjYqN+uZ8npHlg0lh3Mg6Wr3i2D fQW8x8eod8ULs8WBBsE2jgndF0u/WqDRWUj5nUU2mJrmczNbSUAmOf0PqecBuqRr V5TyUR56orq9TLNUtSWGtVGgeaXfTyvQzTLOl5fAnrHn3HNve+WqydWQ= X-Virus-Scanned: amavisd-new at experts-exchange.com Received: from mail.experts-exchange.com ([127.0.0.1]) by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gSse76EAhlWR; Tue, 29 Mar 2011 11:23:18 -0700 (PDT) Received: from experts-exchange.com (unknown [72.29.180.81]) by mail.experts-exchange.com (Postfix) with SMTP id 685CF74479C; Tue, 29 Mar 2011 11:23:18 -0700 (PDT) Received: (nullmailer pid 2447 invoked by uid 1001); Tue, 29 Mar 2011 18:19:49 -0000 Date: Tue, 29 Mar 2011 11:19:49 -0700 From: Jason Helfman To: Nerius Landys Message-ID: <20110329181949.GH15983@eggman.experts-exchange.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 8.2-RELEASE X-Living-The-Dream: I love the SLO Life! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Mailing List Subject: Re: Using "/etc/rc.d/netif start" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 18:23:19 -0000 On Tue, Mar 29, 2011 at 10:40:19AM -0700, Nerius Landys thus spake: >First off, I'm on 9.0-CURRENT-i386, but I don't think that will make a >difference for purposes of my question. I think the freebsd-current >folks are expecting questions that are much harder than this one. > >I'm trying to use /etc/rc.d/netif to bring down and bring back up all >network interfaces, because I'm trying to get the correct entries in >/etc/rc.conf for testing some extra network cards. > >So right now, my /etc/rc.conf looks like this: > >defaultrouter="192.168.0.254" >hostname="elmer.i" >ifconfig_em0="inet 192.168.0.6 netmask 255.255.255.0" > >/etc/resolv.conf looks like this: > >domain i >nameserver 192.168.0.254 > >I'm basically in a LAN. When I boot up this "elmer.i" machine, >everything works well. > >Then, I do the following two commands: > > /etc/rc.d/netif stop > /etc/rc.d/netif start > >After these, I'm still able to ping a raw IP LAN address such as >192.168.0.254. However, two problems start occurring: > >1. I cannot ping an IP address that is outside of my LAN, e.g. >> ping 64.156.192.169 >PING 64.156.192.169 (64.156.192.169): 56 data bytes >ping: sendto: No route to host > >2. DNS (via 192.168.0.254 nameserver) won't work at first, but starts >to magically work when I for example enable sshd and log in to elmer >from another host on the LAN > > >So the nut of my question is, I think "/etc/rc.d/netif stop" stops >some additional things such as packet routing that the corresponding >"/etc/rc.d/netif start" command won't start back up. So what is the >best way to bring down the network and bring it back up again for >purposes of testing /etc/rc.conf syntax? In my experience, I've found it best to restart 'routing,' as well. /etc/rc.d/routing restart -jgh -- Jason Helfman System Administrator experts-exchange.com http://www.experts-exchange.com/M_4830110.html E4AD 7CF1 1396 27F6 79DD 4342 5E92 AD66 8C8C FBA5