Problem with Ad-hoc wireless network Windows to Linux (no ping) - Networking

This is a discussion on Problem with Ad-hoc wireless network Windows to Linux (no ping) - Networking ; Hello All, Sorry for the verbosity of this post... I am trying to set up an ad-hoc wireless network between two computers; one runing Windows XP and the other Linux (2.6.x, Slackware). After I have set them up I cannot ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: Problem with Ad-hoc wireless network Windows to Linux (no ping)

  1. Problem with Ad-hoc wireless network Windows to Linux (no ping)

    Hello All,

    Sorry for the verbosity of this post...

    I am trying to set up an ad-hoc wireless network between two
    computers; one runing Windows XP and the other Linux (2.6.x,
    Slackware).
    After I have set them up I cannot ping the Linux machine from the
    Windows machine.

    This is what I have done so far:

    * Made sure that the Wlan card is running on the Linux machine
    (it is; it's a RT61 based D-Link DWL-G510). It works fine when in
    "managed" mode (connecting to an access-point); I'm using the latest
    firmware/drivers I could find.
    * Made sure that the Wlan card is running on the Windows machine
    (it is; Intel something-something built into a Dell laptop).

    Then I try to set things up.

    ** On the Linux machine:

    $ modprobe rt61 (load module, card is recognized)
    $ iwconfig ra0 essid box (ra0 is my RT61, set SSID)
    $ iwconfig ra0 channel 11 (we are in Europe)
    $ iwconfig mode Ad-Hoc (this is what I want; no encryption)
    $ ifconfig eth0 down (just in case; remember ra0 is the WLan
    card)
    $ ifconfig ra0 10.0.0.1 netmask 255.255.255.0 up (interface comes up)

    $ ifconfig ra0
    ra0 Link encap:Ethernet HWaddr 00:19:5B:70:2D2
    inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
    inet6 addr: fe80::219:5bff:fe70:2dd2/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3 errors:0 dropped:0 overruns:0 frame:0
    TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:192 (192.0 b) TX bytes:468 (468.0 b)
    Interrupt:10

    $ iwconfig ra0
    ra0 RT61 Wireless ESSID:"" Nickname:""
    Mode:Ad-Hoc Frequency:2.462 GHz Cell: 66:9F:2CA:89:A7
    Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Encryption keyff
    Link Quality=0/100 Signal level:-121 dBm Noise level:-99
    dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0
    (note: the empty ESSID is normal. The card broadcasts the name
    anyways)

    $route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref
    Use Iface
    10.0.0.0 0.0.0.0 255.255.255.0 U 0 0
    0 ra0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
    0 lo

    From what I can see the "ra0" interface is up and running and it's
    wating for an "Ad-hoc Handshake" or similar. We also have a
    rudimentary routing table.

    ** Now I configure the Windows machine

    * Enable Wireless (OK)
    * In the network list I can see the "box" station configured on the
    Linux machine.
    * Tell the Wireless card to start an ad-hoc network with SSID "box"
    on channel 11 with no encryption (it's "open")
    * Set properties for the "wireless network connection" in the control
    panel so it reads:

    IP-address ........ 10.0.0.2
    Netmask ........ 255.255.255.0
    Standard gateway .. 10.0.0.1

    After a few seconds I get a "green light" and Windows tells me I am
    connected to the "box" network. Now the Windows machine has IP
    10.0.0.2 with netmask 255.255.255.0 (ipconfig.exe confirms this).

    Now: I still cannot ping the Linux machine (10.0.0.1 [255.255.255.0]).

    I get no reports of connection problems. Still every ping times out.
    Of course, when connected to an "ordinary" lan I can ping the Linux
    machine from Windows without problems.

    I suspect that I am doing something stupid with the routing
    thingamajig
    but I can't figure out what.

    Any ideas? Has anyone else managed to set up a simple ad-hoc
    connection in this fashion? What am I doing wrong here?

    Regards,

    Tobias Andersson

  2. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    It looks like you didn't setup the routing on the linux box.

    # route add default ra0
    or
    # route add default gw 10.0.0.2

    > $route -n
    > Kernel IP routing table
    > Destination Gateway Genmask Flags Metric Ref
    > Use Iface
    > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0
    > 0 ra0
    > 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
    > 0 lo


    There should be two ra0 entries. The second should be similar with the
    Destination / Gateway entries swapped.

    # route -n
    # netstat -r

    Beyond that it looks like you're setup/connected. Just that any pings
    don't have a route to travel to return to the windows box. A ping from
    the linux box to the windows box will likely give a no route to host
    error. Or destination host unreachable. Assuming the firewall isn't
    dropping them altogether.

  3. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    Thank you for your suggestion:

    > It looks like you didn't setup the routing on the linux box.
    >
    > # route add default gw 10.0.0.2


    I did add a default gateway but the problem persists.
    The machine simply won't talk to each other over the ad-hoc link.

    This is not limited to simply pingning the machines. I started proftpd
    on the linux box and
    tried to connect to it from windows:

    > ftp 10.0.0.1


    but it won't (no response from server).

    > Beyond that it looks like you're setup/connected. [...]


    I know. Windows says the machines are connected (point-to-point) and
    it's interface has
    good values; still no packets from the Winbox arrives at the Linux
    box.

    Is there some special "thing" you have to do in Linux when setting up
    an ad-hoc link in this fassion?

    Regards

  4. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    tangens0@gmail.com wrote:

    > Is there some special "thing" you have to do in Linux when setting up
    > an ad-hoc link in this fassion?


    I haven't followed this thread,
    but it might be worth setting one end - preferably the laptop -
    to Managed, and the other to Ad-Hoc.

    --
    Timothy Murphy
    e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
    tel: +353-86-2336090, +353-1-2842366
    s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

  5. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    Thanks:

    > but it might be worth setting one end - preferably the laptop -
    > to Managed, and the other to Ad-Hoc.


    but it did not help. Besides, the only way I could connect in this way
    (managed to ad-hoc)
    is by setting the ad-hoc card in "master" mode (so the card basically
    pretends to be an
    access-point device); but the linux software doest not support this.

    I should mention that the network settings as such are sane. When I
    "wire" the machines
    to a small switch they behave perfectly (same settings as in original
    post but substitute
    ra0 for eth0).

    The problem persists. Both machines say that the ad-hoc link is up but
    no machine will talk to the other.

    Regards /Tobias A




  6. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    > Is there some special "thing" you have to do in Linux when setting up
    > an ad-hoc link in this fassion?


    I wouldn't say special thing. But obviously something you're missing.
    Make sure the windows box is setup for TCP/IP and not just NetBeui(sp?).
    And too little information has been provided.

    Need outputs for linux from:

    ifconfig -a

    iwconfig

    route -n

    netstat -r

    And depending on disto, contents of /etc/network/interfaces or other file.

    For windows output for:

    ipconfig /ALL

    route PRINT

    Something is missing in there. Or it might just be the firewall dropping
    everything. I'm not sure why your wireless is ra0 though. Normally
    that'd be wlan0, or eth# if your distro didn't account for wireless. I had
    to change the udev rules to get mine to be wlan0. It was just too much
    headache to try and remember which was wireless and which was ethernet,
    eth0 or eth1.

    I guess one should ask, not that you have the resources to check (multiple
    machines multiple OS's). Can the windows box connect to other windows
    box's? Can the linux box connect with other linux box's?

    As far as AdHoc or Managed. Doesn't really matter. AdHoc is generally
    for smaller networks and computer to computer connections. But it
    can/will handle multiple connections. Managed just has a lot less
    overhead on larger networks. In general if the connection is AdHoc, then
    both machines should be set to that.

    As far as default gateway. Try the default interface first. There can be
    only one. One default that is. And unless the other box is setup with
    NAT or ICS (windows), then it's not likely a gateway anyway. Not to
    mention that 10.0.0.2 might not be it's address. With only 256x256x256x256
    addresses to choose from. Technically 254 since 0 and 255 are special.

    Does iwconfig say that ra0 has wireless extensions? If not, then you
    probably need a wireless device driver. atmel, prism54, ndiswrapper,
    wlan-ng, ???

  7. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    > Make sure the windows box is setup for TCP/IP and not just NetBeui(sp?).

    The winbox is set up to use TCP/IP.

    > And too little information has been provided.
    > ifconfig -a


    eth0 Link encap:Ethernet HWaddr 00:40:63:EE:6E:C0
    inet addr:192.168.0.163 Bcast:192.168.0.255 Mask:
    255.255.255.0
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:3013 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2177 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:281909 (275.3 KiB) TX bytes:311739 (304.4 KiB)
    Interrupt:11 Base address:0xa000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:20 errors:0 dropped:0 overruns:0 frame:0
    TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1652 (1.6 KiB) TX bytes:1652 (1.6 KiB)

    ra0 Link encap:Ethernet HWaddr 00:19:5B:70:2D2
    inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
    inet6 addr: fe80::219:5bff:fe70:2dd2/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:7 errors:0 dropped:0 overruns:0 frame:0
    TX packets:10 errors:1 dropped:1 overruns:0 carrier:0
    collisions:2 txqueuelen:1000
    RX bytes:376 (376.0 b) TX bytes:468 (468.0 b)
    Interrupt:10


    > iwconfig


    ra0 RT61 Wireless ESSID:"" Nickname:""
    Mode:Ad-Hoc Frequency:2.462 GHz Cell: 7A:9F:32:50:B1:FA
    Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Encryption keyff
    Link Quality=75/100 Signal level:-44 dBm Noise level:-100
    dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    > route -n


    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref
    Use Iface
    10.0.0.0 0.0.0.0 255.255.255.0 U 0 0
    0 ra0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
    0 lo
    0.0.0.0 10.0.0.2 0.0.0.0 UG 0 0
    0 ra0

    > netstat -r


    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window
    irtt Iface
    10.0.0.0 * 255.255.255.0 U 0 0
    0 ra0
    loopback * 255.0.0.0 U 0 0
    0 lo
    default 10.0.0.2 0.0.0.0 UG 0 0
    0 ra0

    > And depending on disto, contents of /etc/network/interfaces or other file.


    I will look this up (I'm running Slackware)

    > For windows output for:
    > ipconfig /ALL


    This will all be in swedish unfortunately but I think you can identify
    the interesting settings for the wireless device anyways: it's at the
    end "trådlös" means wireless and Nej=No, Ja=Yes.

    IP-konfiguration för Windows

    Värddatornamn . . . . . . . . . . : kg3
    Primärt DNS-suffix . . . . . . . :
    Nodtyp . . . . . . . . . . . . . : Okänd
    IP-routning aktiverat . . . . . . : Nej
    WINS-proxy aktiverat . . . . . . : Nej

    Ethernet-kort Anslutning till lokalt nätverk:

    Medietillstånd . . . . . . . . . . : Mediet är frånkopplat
    Beskrivning . . . . . . . . . . . : Broadcom 440x 10/100
    Integrated Controller
    Fysisk adress . . . . . . . . . . : 00-15-C5-75-18-31

    Ethernet-kort Trådlös nätverksanslutning:

    Anslutningsspecifika DNS-suffix . :
    Beskrivning . . . . . . . . . . . : Dell Wireless 1370 - Mini-
    PCI-kort för trådlösa nätverk
    Fysisk adress . . . . . . . . . . : 00-19-7D-0C-78-0A
    DHCP aktiverat . . . . . . . . . : Nej
    IP-adress . . . . . . . . . . . . : 10.0.0.2
    Nätmask . . . . . . . . . . . . . : 255.255.255.0
    Standard-gateway . . . . . . . . : 10.0.0.1

    > route PRINT


    Swedish again... "aktiva vägar" means active routes (I guess)

    ================================================== =========================
    Gr„nssnittslista
    0x1 ........................... MS TCP Loopback interface
    0x2 ...00 15 c5 75 18 31 ...... Broadcom 440x 10/100 Integrated
    Controller - Miniport för paketschemaläggning
    0x3 ...00 19 7d 0c 78 0a ...... Dell Wireless 1370 - Mini-PCI-kort för
    trådlösa nätverk - Miniport för paketschemaläggning
    ================================================== =========================
    ================================================== =========================
    Aktiva v„gar:
    N„tverksadress N„tmask Gateway-adress Gr„nssnitt
    M†tt
    0.0.0.0 0.0.0.0 10.0.0.1 10.0.0.2
    30
    10.0.0.0 255.255.255.0 10.0.0.2 10.0.0.2
    30
    10.0.0.2 255.255.255.255 127.0.0.1 127.0.0.1
    30
    10.255.255.255 255.255.255.255 10.0.0.2 10.0.0.2
    30
    127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
    1
    224.0.0.0 240.0.0.0 10.0.0.2 10.0.0.2
    30
    255.255.255.255 255.255.255.255 10.0.0.2 2
    1
    255.255.255.255 255.255.255.255 10.0.0.2 10.0.0.2
    1
    Standard-gateway: 10.0.0.1
    ================================================== =========================

    > Something is missing in there. *Or it might just be the firewall dropping
    > everything. *I'm not sure why your wireless is ra0 though. *Normally


    The RT61 driver assigns ra0 as the wireless device. The name should
    not make a difference. I have connected to an access point earlier
    with this device (in managed mode) without problems.

    > I guess one should ask, not that you have the resources to check (multiple
    > machines multiple OS's). *Can the windows box connect to other windows
    > box's? *Can the linux box connect with other linux box's?


    I haven't tried this yet. I will.

    > Does iwconfig say that ra0 has wireless extensions? *If not, then you


    It does. See output of iwconfig above.

    Thanks.

    /Tobias A

  8. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    tangens0@gmail.com wrote:

    >> but it might be worth setting one end - preferably the laptop -
    >> to Managed, and the other to Ad-Hoc.

    >
    > but it did not help. Besides, the only way I could connect in this way
    > (managed to ad-hoc)
    > is by setting the ad-hoc card in "master" mode (so the card basically
    > pretends to be an
    > access-point device); but the linux software doest not support this.


    I don't really understand your response.
    Why can you not set your laptop card to Managed? eg with
    sudo iwconfig ra0 mode Managed
    Are there WiFi cards that don't support this mode?

    I don't have great confidence that this will work -
    but I don't see why it is not possible.

    I used to run WiFi this way -
    with a PCI WiFi card on my desktop in Ad-Hoc mode.
    I found I had to set my laptop Orinoco PCMCIA card to Managed
    for the connection to work.

    However, I have used a LinkSys WR54GL access point for some years,
    so the issue no longer arises for me.

    Other suggestions: is there a firewall running on your Linux box?
    Or on the Windows box?
    Are you running NetworkManager?
    What are the relevant entries in /var/log/messages on your laptop?





    --
    Timothy Murphy
    e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
    tel: +353-86-2336090, +353-1-2842366
    s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

  9. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    > Why can you not set your laptop card to Managed? eg with
    > sudo iwconfig ra0 mode Managed
    > Are there WiFi cards that don't support this mode?


    There are drivers and driver version(s) that only let you change a value
    once. My broadcom cards used to have to have the essid set first,
    otherwise you couldn't change it. Using the ndiswrapper driver of course.
    But that was a long time ago. Things are better now, but I wouldn't say
    perfect. I still have to set mode/rate/key off/essid with iwconfig before
    running dhclient3 to connect to some wifi hotspots(McDonalds / Texas Rest
    Stops). Especially those still on 802.11b. Sometimes I even have to set an
    IP for myself before it'll let me connect using dhclient3(Texas Library).

  10. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    On 2 Mar, 04:52, Shadow_7 wrote:
    > > Why can you not set your laptop card to Managed? eg with
    > > * * * * sudo iwconfig ra0 mode Managed
    > > Are there WiFi cards that don't support this mode?


    Perhaps I should clarify. The wlan card on the Linuxbox can be set to
    managed
    mode yes but then the windows laptop refuse to make an ad-hoc
    connection
    to it. I must set both cards to "ad-hoc mode".

    The problem persists. I'm thinking of getting a couple of cheap USB
    bluetooth
    adapters and setting up a network that way instead.

    /Tobias a



  11. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    tangens0@gmail.com wrote:

    > On 2 Mar, 04:52, Shadow_7 wrote:
    >> > Why can you not set your laptop card to Managed? eg with
    >> > sudo iwconfig ra0 mode Managed
    >> > Are there WiFi cards that don't support this mode?

    >
    > Perhaps I should clarify. The wlan card on the Linuxbox can be set to
    > managed
    > mode yes but then the windows laptop refuse to make an ad-hoc
    > connection
    > to it. I must set both cards to "ad-hoc mode".


    I don't follow you.
    I thought you didn't have a connection any time.

    > The problem persists. I'm thinking of getting a couple of cheap USB
    > bluetooth
    > adapters and setting up a network that way instead.


    I doubt if that is wise.
    I haven't read of many people setting up a Bluetooth LAN
    and being happy with it.

    I'm pretty sure your problem is solvable,
    if you go through the possibilities.

    Also, the fault may lie with the Windows machine.

    1) Is there a Windows firewall running?

    2? What relevant messages do you get in /var/log/messages
    on your Linux machine?

    3) Is NetworkManager running?
    If it is, try turning it off.
    If it isn't, try turning it on.

    4) What does "iwlist ra0 scan" say?

    --
    Timothy Murphy
    e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
    tel: +353-86-2336090, +353-1-2842366
    s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

  12. Re: Problem with Ad-hoc wireless network Windows to Linux (no ping)

    > 4) What does "iwlist ra0 scan" say?

    iwlist ra0 scanning

    And various other wireless-tools options to ID what the linux box does
    see. I still think it's a routing issue. Windows or linux. A netmask of
    255.255.255.255 means it can only talk to itself. A netmask of
    255.255.255.0 means it can talk to any box with the first three numbers
    matching. As long as that box is listening.

    when you ping, what are you getting? no route to host? host unreachable?
    or just 100% packet loss?

+ Reply to Thread