All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: meta-freescale@yoctoproject.org
Subject: Re: gateway is missing
Date: Tue, 25 Mar 2014 05:58:09 -0600	[thread overview]
Message-ID: <53316F51.60906@mlbassoc.com> (raw)
In-Reply-To: <CAKQdxxaBKoomPq78Dx27Gkd2CpB0ZEJAQeM0wWpqyWvS+6m8gQ@mail.gmail.com>

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
------------------------------------------------------------


  parent reply	other threads:[~2014-03-25 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 20:45 gateway is missing Niklas Molin
2014-03-25  2:09 ` Otavio Salvador
2014-03-25  3:05   ` Niklas Molin
2014-03-25 11:49     ` Otavio Salvador
2014-03-25 14:00       ` Niklas Molin
2014-03-25 11:58 ` Gary Thomas [this message]
2014-03-25 12:07   ` Otavio Salvador

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53316F51.60906@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.