From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.chez-thomas.org (mail.mlbassoc.com [65.100.170.105]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0FB64E003C7 for ; Tue, 25 Mar 2014 04:58:05 -0700 (PDT) Received: by mail.chez-thomas.org (Postfix, from userid 1998) id 1F506F811E9; Tue, 25 Mar 2014 05:58:05 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hermes.chez-thomas.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=4.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from [192.168.1.114] (zeus [192.168.1.114]) by mail.chez-thomas.org (Postfix) with ESMTP id 7E53AF811E4; Tue, 25 Mar 2014 05:58:03 -0600 (MDT) Message-ID: <53316F51.60906@mlbassoc.com> Date: Tue, 25 Mar 2014 05:58:09 -0600 From: Gary Thomas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: meta-freescale@yoctoproject.org References: In-Reply-To: X-Enigmail-Version: 1.5.2 Subject: Re: gateway is missing X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:58:09 -0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2014-03-24 14:45, Niklas Molin wrote: > Hi. > > I'm trying to toggle the eth0 with ifconfig > I noticed that it I couldn't access my board after that. > After some more testing it seems like I can't access my board from a different subnetwork. > So I did a route -nee (before and after eth0 down and up) and it seems lie the gateway is gone. > > root@imx6qsabresd:~# route -nee > Destination Gateway Genmask Flags MSS Window irtt Iface > 0.0.0.0 192.168.55.1 0.0.0.0 UG 0 0 0 eth0 > 192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > root@imx6qsabresd:~# ifconfig eth0 down > root@imx6qsabresd:~# ifconfig eth0 up > > When link is back: > root@imx6qsabresd:~# route -nee > Kernel IP routing table > Destination Gateway Genmask Flags MSS Window irtt Iface > 192.168.55.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > > I did this on a SabreSD and also my custom board. > > Is there anything I'm missing in my setup? When you run 'ifconfig eth0 down', not only is that interface marked as 'down', but all routes which are based on it are deleted. When you bring it back up with 'ifconfig eth0 up', the system has no idea that you need any additional routing, etc. (In fact, it can't make any assumptions about this at all). I suspect that your interface (eth0) was originally brought up when the system booted. To keep the same behaviour, you'll need to use the same mechanism as that. Try this: # /etc/init.d/networking restart Alternatively, you should use different commands to take the interface up/down. Use 'ifdown eth0' instead of 'ifconfig eth0 down' 'ifup eth0' instead of 'ifconfig eth0 up' These commands will respect the setup you have in /etc/network/interfaces where the raw 'ifconfig' commands do not. -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------