From owner-freebsd-questions@freebsd.org Mon Jan 7 20:12:16 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F47149E275 for ; Mon, 7 Jan 2019 20:12:16 +0000 (UTC) (envelope-from jjohnstone@tridentusa.com) Received: from mail.tridentusa.com (mail.tridentusa.com [96.225.19.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C86E77020 for ; Mon, 7 Jan 2019 20:12:05 +0000 (UTC) (envelope-from jjohnstone@tridentusa.com) Received: (qmail 67451 invoked by uid 1002); 7 Jan 2019 20:11:59 -0000 X-Qmail-Scanner-Diagnostics: from mail.tridentusa.com by smtprelay.tridentusa.com (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25277. spamassassin: 3.4.2. Clear:RC:1(172.16.0.32):. Processed in 0.035036 secs); 07 Jan 2019 20:11:59 -0000 Received: from mail.tridentusa.com (172.16.0.32) de/crypted with TLSv1: DHE-RSA-AES256-SHA [256/256] DN=none by smtprelay.tridentusa.com with ESMTPS; 7 Jan 2019 20:11:59 -0000 Received: (qmail 37841 invoked from network); 7 Jan 2019 15:11:58 -0500 Received: from johnstone (HELO ?192.168.249.6?) (jjohnstone@tridentusa.com@192.168.249.6) by mail.tridentusa.com with SMTP; 7 Jan 2019 15:11:58 -0500 Subject: Re: FreeBSD-11.2 routing and networks To: freebsd-questions@freebsd.org References: <1a466d730772d5ceb62ddfb204c92db5.squirrel@webmail.harte-lyne.ca> <1e5a2c5bdc65f1cf8e2c5d12d6cec983.squirrel@webmail.harte-lyne.ca> Cc: byrnejb@harte-lyne.ca From: John Johnstone Message-ID: <800a0ad3-03b9-e392-1dd9-aff94e6ad27d@tridentusa.com> Date: Mon, 7 Jan 2019 15:11:58 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1e5a2c5bdc65f1cf8e2c5d12d6cec983.squirrel@webmail.harte-lyne.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7C86E77020 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of jjohnstone@tridentusa.com designates 96.225.19.3 as permitted sender) smtp.mailfrom=jjohnstone@tridentusa.com X-Spamd-Result: default: False [-1.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.60)[-0.605,0]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.85)[-0.855,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tridentusa.com]; NEURAL_SPAM_SHORT(0.08)[0.076,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail1.tridentusa.com,mail.tridentusa.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[3.19.225.96.list.dnswl.org : 127.0.10.0]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:701, ipnet:96.225.0.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.17)[asn: 701(-0.78), country: US(-0.08)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2019 20:12:16 -0000 On 1/7/19 11:15 AM, James B. Byrne via freebsd-questions wrote: > > > On Mon, January 7, 2019 11:06, Odhiambo Washington wrote: >> On Mon, 7 Jan 2019 at 19:01, James B. Byrne via freebsd-questions < >> freebsd-questions@freebsd.org> wrote: >> >>> I am working on a FreeBSD-11.2p17 host where I must change the IP >>> address and gateway frequently to carry out tests. Following making >>> such changes I have tried resetting the network interfaces and >>> routing tables by use of the command: >>> >>> service netif restart && service routing restart & >>> >>> However, I have discovered that this does not have the desired >>> effect and I am reduced to restarting the host system to make >>> such changes. > As it happens, for the moment this case is true, I do have console > access. However, the configuration testing that I am doing locally > will need to be applied to a remote host at some point, and the > console will not be an option. Is there no way to make FreeBSD reset > the network connection and routing tables remotely? Might be better to give more details about your "desired effect". Changes to IP address and gateway via ifconfig and route commands like ifconfig bce0 192.168.1.100 255.255.255.0 route [add][change] default 192.168.1.1 take place immediately. If you do an ifconfig and netstat -rn before your changes and then do them afterwards to verify you can confirm what's being done. There are some consequences that aren't obvious. One being the fact that the when you change the IP of an interface that is used for your default gateway, the default gateway is removed. You can see this by doing a netstat -rn, change your IP with ifconfig, and then do the netstat again. But if you were logged in remotely with IP routing taking place between you and your box via your default gateway, as soon as you change your IP, you'll orphan yourself because your box has no way to reach you because your default gateway is gone. I haven't used service netif restart remotely but I would expect that you would loose your connection if it was going through the default gateway just as if you issued the ifconfig command manually. It has the advantage though of taking the IP and gateway simultaneously from rc.conf which allows you to re-establish your connection to the box again after the changes are in effect. - John J.