LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-27-2007, 11:12 PM   #1
slamb2002
LQ Newbie
 
Registered: Sep 2007
Distribution: Kubuntu Feisty
Posts: 2

Rep: Reputation: 0
Question Network Bridge Ad-hoc Wireless Ubuntu


I have a dual booting Kubuntu / XP box plugged into my cable modem. I also have a wireless laptop running XP (Kubuntu done via VMWare) for work. I have an ad-hoc wireless network configured in windows, so that when I come home, my laptop automatically detects it, and connects. It was slick and easy to set up. I haven't been able, for the life of me to do the same in ubuntu. I have tried numerous articles, but just don't find one with my exact same situation. Wireless card is a Linksys Wusb54g v.4 and is rausb0.

So as I see it, I want to do two things. Make my linux box a ad-hoc network. Bridge my ethernet connection (eth0) with the wireless (rausb0)

Can anyone help me?

I have been using linux for a while, and have had some programming, so I don't consider myself a total noob.
 
Old 09-29-2007, 07:08 AM   #2
pokemaster
Member
 
Registered: Apr 2005
Location: Massachusetts, USA
Distribution: debian,ubuntu,slackware
Posts: 110

Rep: Reputation: 17
Follow these steps:

1 ) set up your ad-hoc network (both machines... make sure that everything is the same for both machines, except the ip address, which of course needs to be different)
Code:
iwconfig *thX mode ad-hoc
iwconfig *thX essid MyNetwork
iwconfig *thX enc aabbc-aabbc
ifconfig *thX 192.168.1.X
2 ) enable ip forwarding
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
3 ) establish ip masquerading (this is on the desktop)
Code:
iptables -t nat -A POSTROUTING -j MASQUERADE
4 ) setup the default gateway (this is on the laptop, X.X.X.X is the ip of the desktop on your ad-hoc network)
Code:
route add default gw X.X.X.X
Hope this helps!

[edit] I just re-read your post and realized you have windows hosting linux, not the other way around. That last line about route add gw is wrong now -- and the first line also no longer applies to the laptop... Set up the windows wireless with the same settings as the desktop for ad-hoc, and then fire up cmd.exe:
Code:
route add 0.0.0.0 mask 0.0.0.0 X.X.X.X
Subbing in the desktop's ip, of course. This line I haven't tested, but it follows microsoft's documentation for their route command setting up a default gateway, and should work.

Last edited by pokemaster; 09-29-2007 at 07:14 AM.
 
Old 10-01-2007, 04:16 PM   #3
slamb2002
LQ Newbie
 
Registered: Sep 2007
Distribution: Kubuntu Feisty
Posts: 2

Original Poster
Rep: Reputation: 0
I did exactly as was suggested. My linux machine shows that I am connected to my essid, my windows machine shows the same. However, my windows machine just sends packets and does not receive any. What is going on? Is there any way to test what I have done?

I'm not sure if I was supposed to do more with the iptables and masquerading. For the sake of simplicity lets just say my linux desktop is going to be 192.168.1.1 and the laptop 192.168.1.2 on subnet mask 255.255.0.0 . Additionally, is there any way to set up my windows machine to use auto dns or do I have to manually set ip addys?
 
Old 10-01-2007, 04:52 PM   #4
pokemaster
Member
 
Registered: Apr 2005
Location: Massachusetts, USA
Distribution: debian,ubuntu,slackware
Posts: 110

Rep: Reputation: 17
I don't know why it didn't work... have you tried pinging the linux box to make sure the ad-hoc connection is working properly? (i.e. ping 192.168.1.1).


I've actually gone ahead and done exactly what I told you to do above, except the client is also linux, instead of windows. It's entirely possible that I've given you the wrong command for the windows routing table.


Finally, the short answer is yes, you can set up automatic dns. The long one is that it's not just that simple: I've never set up a linux machine to be a dns server, though I know it's possible and I've seen it done on numerous occasions. If that's what you want, maybe someone else can fill us in with the down & dirty of running dns on a linux box?
 
  


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
Unable to ping machines on a wireless ad-hoc network Pieman86 Linux - Wireless Networking 4 11-16-2006 03:29 PM
Ad-hoc wireless network stopped working Lord_Grave Linux - Hardware 0 01-18-2006 04:33 PM
problem with wireless ad-hoc network creation on Mandrake 9.2... superczar Linux - Wireless Networking 0 08-05-2005 01:30 AM
My wireless ad-hoc network seems to work, but when I try to explore WWW it doesn't!! marioneri Linux - Wireless Networking 2 01-23-2005 08:52 PM
VNC for RH 7 in a wireless mobile ad-hoc network sceadu Linux - Wireless Networking 1 04-15-2003 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:27 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