Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-linux] Get rid of wired connection after installing wireless USB dongle on wlan0

Expand Messages
  • Mike (mwester)
    ... There s the root cause. You cannot have a single system have two interfaces on the same network, even if the two use different types of media. There s
    Message 1 of 3 , Jul 4 8:52 PM
    • 0 Attachment
      Pertinent portions of original message below:

      > The problem starts when I try and then unplug the ethernet cable.
      > As soon as I do that I cannot ping the slug on either ethernet
      > (obviously) nor wireless lan.
      >
      > iface eth0 inet static
      > address 192.168.1.77
      >
      > iface wlan0 inet static
      > address 192.168.1.78

      There's the root cause. You cannot have a single system have two interfaces
      on the same network, even if the two use different types of media. There's
      nothing in the Linux kernel that prevents you from doing this, but it
      generally plays havoc with your routing tables, and confuses DHCP servers
      and DNS servers, and results in generally unpredictable behavior when one of
      the interfaces fails or is disabled.

      So, you have two choices: either split your network into two distinct
      subnets, one for wired and one for wireless, or you must arrange that only
      one is active at a time.

      The latter is actually easy to do. Just remote the "auto wlan0" line or the
      "auto eth0" line, whichever interface you don't want started at boot. Then
      when you switch, you need to execute something line "ifdown eth0; sleep 5;
      ifup wlan0". Since your ssh session will die, you'll need to do that in the
      background via something like "nohup". You might be able to get away
      without the pause in-between, but I'd start with that just to give various
      services a chance to die if they are going to do so.

      That makes debugging particularly hard. A serial console is very helpful.
      See the wiki for how to add one, it requires a bit of soldering. Since you
      really don't need to see the boot messages, just be able to survive a
      network shutdown and startup, you can also add a serial port via a
      USB->serial adaptor, and start a login session on that serial adaptor. That
      way you can issue the commands from a direct login session to debug things.

      The two-network thing will allow you to split the network, so that you can
      have both interfaces running at the same time. The routing table determines
      which interface is used for what traffic, giving you some control over how
      things are working.

      Which raises an interesting point --- are you SURE that the wireless port is
      working? Since BOTH ports are on the same network, how do you know that
      packets are flowing over the wireless at all?

      I've worked on this in the past -- the sequence above will work just fine.
      However, I don't use that anymore, I use dual networks for development work.
      In addition to allowing me to run both interfaces simultaneously, it also
      allows me to get the wireless card (in my case a zd1211 card) working with
      the simpler WEP security on an isolated wireless subnet, while leaving the
      main wireless network running WPA.

      Mike (mwester)
    • Euan Macfarlane
      Mike, Thanks for the info that s very helpful. Sorry for late reply I ve had a bit of a disaster since I broke my interfaces file. Anyway, ethernet s fixed
      Message 2 of 3 , Jul 12 1:56 PM
      • 0 Attachment
        Mike,
        Thanks for the info that's very helpful. Sorry for late reply I've
        had a bit of a disaster since I broke my interfaces file. Anyway,
        ethernet's fixed now even if wireless still not working.
        I need to use the dual interface option as the plan is to use the
        ethernet port (for bridging) and wireless at the same time.
        I've since tried a couple of things and not had much success. My
        route table now says:

        Destination Gateway Genmask Flags Metric Ref
        Use Iface
        192.168.2.0 * 255.255.255.0 U 0 0
        0 eth0
        localnet * 255.255.255.0 U 0 0
        0 wlan0
        default 192.168.1.1 0.0.0.0 UG 0 0
        0 wlan0

        So only one default gateway and ethernet on 192.168.2.0 subnet while
        the wireless is on 192.168.1.1
        I'm beginning to wonder whether it's the wireless dongle that's the
        problem. It picks up my network when I do a iwlist scan but when I
        try to to use dhcp it never works.
        Any further thoughts much appreciated.
        Thanks,
        Euan

        On 5 Jul 2007, at 04:52, Mike (mwester) wrote:

        > Pertinent portions of original message below:
        >
        > > The problem starts when I try and then unplug the ethernet cable.
        > > As soon as I do that I cannot ping the slug on either ethernet
        > > (obviously) nor wireless lan.
        > >
        > > iface eth0 inet static
        > > address 192.168.1.77
        > >
        > > iface wlan0 inet static
        > > address 192.168.1.78
        >
        > There's the root cause. You cannot have a single system have two
        > interfaces
        > on the same network, even if the two use different types of media.
        > There's
        > nothing in the Linux kernel that prevents you from doing this, but it
        > generally plays havoc with your routing tables, and confuses DHCP
        > servers
        > and DNS servers, and results in generally unpredictable behavior
        > when one of
        > the interfaces fails or is disabled.
        >
        > So, you have two choices: either split your network into two distinct
        > subnets, one for wired and one for wireless, or you must arrange
        > that only
        > one is active at a time.
        >
        > The latter is actually easy to do. Just remote the "auto wlan0"
        > line or the
        > "auto eth0" line, whichever interface you don't want started at
        > boot. Then
        > when you switch, you need to execute something line "ifdown eth0;
        > sleep 5;
        > ifup wlan0". Since your ssh session will die, you'll need to do
        > that in the
        > background via something like "nohup". You might be able to get away
        > without the pause in-between, but I'd start with that just to give
        > various
        > services a chance to die if they are going to do so.
        >
        > That makes debugging particularly hard. A serial console is very
        > helpful.
        > See the wiki for how to add one, it requires a bit of soldering.
        > Since you
        > really don't need to see the boot messages, just be able to survive a
        > network shutdown and startup, you can also add a serial port via a
        > USB->serial adaptor, and start a login session on that serial
        > adaptor. That
        > way you can issue the commands from a direct login session to debug
        > things.
        >
        > The two-network thing will allow you to split the network, so that
        > you can
        > have both interfaces running at the same time. The routing table
        > determines
        > which interface is used for what traffic, giving you some control
        > over how
        > things are working.
        >
        > Which raises an interesting point --- are you SURE that the
        > wireless port is
        > working? Since BOTH ports are on the same network, how do you know
        > that
        > packets are flowing over the wireless at all?
        >
        > I've worked on this in the past -- the sequence above will work
        > just fine.
        > However, I don't use that anymore, I use dual networks for
        > development work.
        > In addition to allowing me to run both interfaces simultaneously,
        > it also
        > allows me to get the wireless card (in my case a zd1211 card)
        > working with
        > the simpler WEP security on an isolated wireless subnet, while
        > leaving the
        > main wireless network running WPA.
        >
        > Mike (mwester)
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.