[meta-freescale] gateway is missing

Otavio Salvador otavio at ossystems.com.br
Tue Mar 25 05:07:55 PDT 2014

Hello Gary,

On Tue, Mar 25, 2014 at 8:58 AM, Gary Thomas <gary at mlbassoc.com> wrote:
> On 2014-03-24 14:45, Niklas Molin wrote:
>> 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 at imx6qsabresd:~# route -nee
>> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
>>         UG        0 0          0 eth0
>>   U         0 0          0 eth0
>> root at imx6qsabresd:~# ifconfig eth0 down
>> root at imx6qsabresd:~# ifconfig eth0 up
>> When link is back:
>> root at imx6qsabresd:~# route -nee
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
>>   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.

I missed completely he were using ifconfig instead of ifup and ifdown.
Thanks for spotting it :-)

Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

More information about the meta-freescale mailing list