From owner-freebsd-questions@FreeBSD.ORG Sat Feb 8 03:07:10 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AD5F8B9 for ; Sat, 8 Feb 2014 03:07:10 +0000 (UTC) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22DD517EB for ; Sat, 8 Feb 2014 03:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=sY+G712Ls/oGOyenA+70aVSep4Tyw90wXk/w/AyT8HA=; b=qkRsG3STT4NYj80DBxAJw4CYxHg5IosN1u/0MDtYdOD5V3GZRIQB7s0oKNfba0bbtvQGAnVRq3igUhwP4Juioo+VFEdGA6qUoNbF78ajMp6P/zz33Im1FnbGNrOUaobv+aHktnaYGDLjC+DbtEhhJwkMtOzT+Lc0y111fy3XsnE=; Received: from [39.218.171.107] (port=61415 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (SSLv3:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from ) id 1WByG4-0000Mu-Qo; Fri, 07 Feb 2014 20:07:09 -0700 Date: Sat, 8 Feb 2014 11:07:01 +0800 From: Erich Dollansky To: Vladislav Prodan Subject: Re: Restart network without reboot ? Message-ID: <20140208110701.14eeb810@X220.alogt.com> In-Reply-To: <1391827303.738906888.k9hzy6eo@frv35.fwdcdn.com> References: <1391822758.499117562.qad9aups@frv35.fwdcdn.com> <20140208102029.04d2eb10@X220.alogt.com> <1391827303.738906888.k9hzy6eo@frv35.fwdcdn.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: Cc: questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 03:07:10 -0000 Hi, On Sat, 08 Feb 2014 04:43:16 +0200 Vladislav Prodan wrote: > > "Erich Dollansky" wrote: > > > > On Sat, 08 Feb 2014 03:31:08 +0200 > > Vladislav Prodan wrote: > > > > > > > > # service netif restart && service routing restart > > > Stopping dhclient. > > > Waiting for PIDS: 672. > > > > > > And disconnect via ssh :( > > > > as expected. > > > > What is your problem? > > What there are other ways to restart the network without breaking the > current ssh session? you have two interfaces. Can you connect to both via ssh or just to one? If you have to restart the interface you are connected to, you will always lose your ssh connection. > > > > # uname -a > > > FreeBSD vm-10-1.domain.com 10.0-STABLE FreeBSD 10.0-STABLE #0 > > > r261419: Mon Feb 3 02:57:25 UTC 2014 > > > root@grind.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 > > > > > > > > > # cat /etc/rc.conf > > > zfs_enable="YES" > > > hostname="vm-10-1.domain.com" > > > ifconfig_em0="DHCP" > > > ifconfig_em1="DHCP" > > > sshd_enable="YES" > > > > > Do you have a procedure in place to know the IP address of the > > machine after the restart? > > > > You should be able to connect to the machine without problems. > > > > I do not know how sshd and inetd behave under this condition. > > > > > I be able to connect directly to the console. > On network interfaces, I see no ip addresses. > Likely to command "service netif stop" killing all processes dhclient > A command "service netif start" will not start dhclient on network > interfaces specified in rc.conf. As a result, I started in the > console "service netif start" and the network appeared. > > Later, I will try to repeat the commands on the FreeBSD 9.1 > I do not use DHCP on my own networks for a simple reason. If the network has to be restarted, the interface(s) get(s) new IP addresses depending on the settings of the DHCP server. If you did not get new addresses, it seems that your DHCP client did not restart. That you have had to kill all dhclients on the console hints that it did not notice that the interfaces have been restarted. If possible, get either rid of DHCP or set the DHCP server so that a specific MAC address gets always the same IP number. If things go real bad then, you can temporarily set a fixed IP address then. Erich