LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 10-04-2005, 01:45 PM   #1
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
Question Ad-Hoc Linux to Windows Network


OK heres the setup.

Homepc(with internet) ---------> my notebook

If I initiate the Ad-hoc from within linux(my notebook), the other system in windows finds it and connects just fine. I'm able to ping and everything. However what I want is to have the home system serving/initating the wireless so that I can just come home and connect. As it is I have to set it up on linux(my notebook), run accross to the other pc and connect it. I would like things the other way around; connect linux wireless to windows wireless network.

Starting basic I've set up an Ad-Hoc on the home system:
ip - 1.1.1.123
essid - abc
no encryption/wep

From windows I can connect to it and ping but in linux I can't. Heres what I tried config wise in linux:
iwconfig ath0 mode Ad-Hoc
iwconfig ath0 essid abc
ifconfig ath0 1.1.1.222

All pings fail.


Incidentally the above commands are what I use to 'serve' the ad-hoc from within linux.
Oh and another point worth mentioning is that under linux my ap is FF:FF:FF:FF:FF:FF i.e. broadcast address so of course logically it would work if I'm serving. Connecting to someone else(within linux) is the problem.
 
Old 10-05-2005, 05:16 AM   #2
combatwombat
Member
 
Registered: Apr 2003
Location: Hastings, Hawkes Bay, NZ
Distribution: Ubuntu Gutsy Gibbon
Posts: 53

Rep: Reputation: 15
Windows firewall in the way?
 
Old 10-05-2005, 11:30 AM   #3
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
nope, no firewalls enabled on any node.
 
Old 10-06-2005, 04:01 AM   #4
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
so what you really need is the windows pc to act as a router, and then connect to it and use it as the gateway? shorewall or ipmasq etc for linux, dunno about windows..
 
Old 10-07-2005, 04:37 PM   #5
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
ok lets rephrase the question:

how do you in Linux connect to an existing ad-hoc peer to peer network?
 
Old 10-07-2005, 06:57 PM   #6
marquisdesade
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Rep: Reputation: 0
Smile

This tutorial on basic IP masquerading might be of help: http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/

I used this to enable the following setup:

A - My linux laptop - connected to cable modem
B - Friend's laptop - Not connected (only 1 port for cable modem)

So I enabled Ad-Hoc mode on my wireless card, and used iptables to forward packets received by my wireless device (from the other laptop) to my ethernet card (and vice versa)... basically acting like a wireless router. I'm not totally sure this is what you're looking for... but what the hell .


Last edited by marquisdesade; 10-07-2005 at 07:05 PM.
 
Old 10-07-2005, 09:50 PM   #7
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
paste the output of ifconfig, iwconfig and route.
 
Old 12-27-2005, 09:58 PM   #8
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
Just a followup as I've got things working.
I'm gonna assume that everyone has their drivers installed and configured
put this in a script

Code:
/sbin/iwconfig ath0 channel 1
/sbin/iwconfig ath0 rate 11M
/sbin/iwconfig ath0 essid youressid
/sbin/iwconfig ath0 key 1234567890
/sbin/ifconfig ath0 1.1.1.117                       #<comment this out if you are using dhcp>
/sbin/route add default ath0
/sbin/route add default gw 1.1.1.1             #<comment this out if you are using dhcp
/sbin/ifconfig ath0 down
sleep 2                                                             # for some reason you need a little delay for changes to be updated
/sbin/ifconfig ath0 up
/sbin/dhcpcd ath0                                         # of course if you're not using dhcp comment this out
It generally seems that you need to manually specify the rate and channel for ad-hoc networks to negotiate reliably.

You all may notice that I've left of specifying '/sbin/iwconfig ath0 mode ad-hoc'
The reason being for madwifi drivers you have to create the card for the operation type BEFORE doing the above commands eg I've made the following script ng-adhoc.sh

Code:
wlanconfig ath0 create wlandev wifi0 wlanmode adhoc
/sbin/ifconfig ath0 up
iwconfig ath0 mode ad-hoc
as opposed to 'wlanconfig ath0 create wlandev wifi0 wlanmode sta' for a infrastructure mode.

People using ndiswrapper will
1-replace 'ath0' with 'wlan0' <this should be obvious>
2-place '/sbin/iwconfig wlan0 mode ad-hoc' BEFORE you set the channel


Good Luck, hope this helps

Last edited by Mr_C; 12-27-2005 at 10:16 PM.
 
Old 12-27-2005, 10:26 PM   #9
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Original Poster
Rep: Reputation: 30
Smile

Quote:
Originally Posted by marquisdesade
This tutorial on basic IP masquerading might be of help: http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/

I used this to enable the following setup:

A - My linux laptop - connected to cable modem
B - Friend's laptop - Not connected (only 1 port for cable modem)

So I enabled Ad-Hoc mode on my wireless card, and used iptables to forward packets received by my wireless device (from the other laptop) to my ethernet card (and vice versa)... basically acting like a wireless router. I'm not totally sure this is what you're looking for... but what the hell .
Thanks, it would be ideal if I wasn't using windows to share the net. <thats the family pc, nuff said>
 
Old 02-19-2009, 08:46 PM   #10
Cybergeek
LQ Newbie
 
Registered: May 2006
Posts: 8

Rep: Reputation: 0
So...

I tried all this and I am still unable to connect to my Windows system. Pain in the but... I have a Windows ICS box with a wireless card and my Fedora Core X is not conecting like it is supposed to.
 
Old 07-26-2010, 05:10 AM   #11
test009
LQ Newbie
 
Registered: May 2010
Location: Russia
Distribution: Ubuntu 10.4
Posts: 7

Rep: Reputation: 0
i had similar issue and searching for resolve now. If i will found some, then im post here.
 
Old 03-02-2011, 07:46 AM   #12
tinoob
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
Fedora 14 wireless cannot connect to vista ad-hoc network

I am trying to do the same connection from FC14 wireless to a vista ad-hoc network with not luck.
Anyone has done that successfully?

it seems that the card is associating and connecting the the network but then it start a dhcpv4 transaction, which obviously fails because vista is not a dhcp server.
Is there anyway around the dhcp cycle?


Thanks

Last edited by tinoob; 03-02-2011 at 07:54 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux ad hoc network with WMM: question elisewin Linux - Wireless Networking 0 11-30-2005 03:31 AM
How to interconnect an ad-hoc network with an infrastructure network tonydeb Linux - Wireless Networking 3 08-08-2005 02:42 PM
Linux 2 Windows Ad-hoc theplop Linux - Networking 0 11-15-2004 07:01 PM
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Networking 1 11-14-2004 11:10 AM
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Wireless Networking 0 11-14-2004 05:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration