Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Feb 2014 11:07:01 +0800
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        Vladislav Prodan <universite@ukr.net>
Cc:        questions@freebsd.org
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>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Sat, 08 Feb 2014 04:43:16 +0200
Vladislav Prodan <universite@ukr.net> wrote:

> > "Erich Dollansky" <erichsfreebsdlist@alogt.com> wrote:
> >
> > On Sat, 08 Feb 2014 03:31:08 +0200
> > Vladislav Prodan <universite@ukr.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140208110701.14eeb810>