LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2009, 09:31 PM   #1
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Rep: Reputation: 0
ICS with XP, Sprint, and Debian (oh yeah, over wifi)


Hi,

I have been working all afternoon and this evening trying to get this wifi internet connection sharing setup. What I am trying to do is this:

Where I live, we don't have DSL, cable, or WAN, and satellite is not an option. So the fastest internet connection I can get that is still affordable is a Sprint mobile broadband connection. I have an XP computer set up that connects to the mobile broadband. I have a laptop that I would like to connect via wifi. It is running Debian squeeze/sid. I looked at getting a router that would generate wifi from the mobile broadband modem, but it was $150, and I wanted to keep this as cheap as possible. I bought a Netgear WGR164 router that is connected to the XP computer via wire. I have ICS (internet connection sharing) setup on XP because before I connected the two computers with a crossover cable. For my laptop, I got a Netgear WG111v2 usb adapter. I managed to get it setup (i think) using ndiswrapper. After messing around all afternoon, I was able to change the router's settings from my laptop. I changed the IP address to 192.168.0.254 so it wouldn't interfere with XP's ICS default 192.168.0.1. After I changed it I could access the setting from the XP computer but not from my laptop. When I try to ping the router from my laptop I get a Destination Host Unreachable. From the XP computer I am able to ping the router just fine. My /etc/network/interfaces looks like this:

Code:
auto lo
iface lo inet loopback

#This was the crossover cable connection
auto eth0
iface eth0 inet dhcp
     address 192.168.0.2
     netmask 255.255.255.0
     gateway 192.168.0.1
     dns-nameserver #Sprint nameservers

allow-hotplug wlan0
iface wlan0 inet dhcp
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1
I hope I've posted enough information.

Thanks in advance.
 
Old 08-12-2009, 07:57 AM   #2
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
What does the output of ifconfig and route look like could you post those as well?
 
Old 08-12-2009, 08:46 AM   #3
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Sure,

ifconfig:
Code:
eth0      Link encap:Ethernet  HWaddr 00:1b:24:25:c3:70  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:21 Base address:0x2000 

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:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:18031 (17.6 KiB)  TX bytes:18031 (17.6 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:24:b2:3b:9a:0a  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wmaster0  Link encap:UNSPEC  HWaddr 00-24-B2-3B-9A-0A-6C-6F-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
and route:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         SCHMIDTPC       0.0.0.0         UG    0      0        0 eth0
I should mention that SCHMIDTPC is the name of the XP computer.
 
Old 08-12-2009, 09:45 AM   #4
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Ok, if I read your post correctly, you originally had the two computers connected via crossover cable, you have now added a wifi router that is connected to the XP machine via a network cable. And you are connecting to the wifi router from the linux machine via wifi, or do you have a network cable connecting it to the wifi router at this time as well?

Some possibilities:
Check to make sure that the XP machine is not plugged into the WAN port of the wifi router otherwise you are likely causing a network routing issue at the router.

If you are connected to the router from the linux machine using Wifi, I notice that the ifconfig output shows that there is no address assigned to the wlan interface. In addition I note that in your interfaces file that you have both eth0 and wlan0 setup with the same ip adddress information and that you setup the interfaces to use dhcp try changing the ip address and network information of the interface you are not using to something different and try changing the dhcp in the iface descriptor to static. Furthermore if you are connecting by wifi is it encrypted? and what are you using to connect to the wifi? If it is encrypted remove all encryption and get it working that way first. Any advice on utility you are using to connect to the wifi i.e network manager, wicd, iwconfig, wpa_supplicant will be mostly utility dependent. Can you get networking if you do connect the linux machine to the router by network cable. Lastly try changing the default router by using the ip address instead of the name of the XP machine.
 
Old 08-12-2009, 11:48 AM   #5
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
OK,

Thanks for the reply. To start, the XP computer is plugged into port 1 of the router. I changed the eth0 interface to static and I changed the wlan0 interface's ip to 192.168.0.3. Still no luck. I tried plugging my laptop into the router with a network cable and, behold, the Internet! So I know the XP computer is set up right, I just need the linux machine configured.

Thanks!
 
Old 08-12-2009, 01:45 PM   #6
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Ok,

So I've played around with it a little more. Now when I disconnect the network cable, plug in the wifi adapter, and try to ping the router, I get connect: Network is unreachable. ? I tried plugging the cable back in and I get the same error. What did I do? Its really important that I get this done because I am programming a free program for a local preschool that needs it done ASAP.

Please help!
 
Old 08-12-2009, 01:48 PM   #7
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Disable your eth0 with ifdown eth0 then try ifdown wlan0 followed by an ifup wlan0 then run ifconfig make sure the output for ifconfig shows the ip address information you entered, if it does not then your interfaces file config isn't taking for the wlan for some reason. If the ifconfig output looks good run route and see the output you should see a line that says
Code:
default    192.168.0.1    (Stuff I don't recall)    wlan0
The key here is that the default route tells the system where to route traffic not destined for a computer on your network (in this case the 192.168.0.x) if you do not have a default route listed or it is not routed over your wlan interface you have no Internet. If the ifconfig is ok and there is no default route but there is a route for the 192.168.0.0 then you can run

Code:
route add default gw 192.168.0.1
That will add the default route, confirm that it took by running route then try accessign the internet.
 
Old 08-12-2009, 01:52 PM   #8
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
I think the crux of your issue lays with your routing table. Or perhaps the connection to your WiFi. What do you use to manage your WiFi on the linux machine? If nothing install wicd or network manager, or even wpa_supplicant. We can configure the WiFi that way. It will also tell us if we are getting any wifi signal, etc....
 
Old 08-12-2009, 02:05 PM   #9
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
OK, ifconfig doesn't seem to show my changes. The route command shows no routes at all, and trying to add the default route gives me an error. I'll try and install wicd. I still can't ping the router.
 
Old 08-12-2009, 02:16 PM   #10
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
wicd says no wireless networks found, but I am sure my router is working.
 
Old 08-12-2009, 02:21 PM   #11
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Yea your wifi isn't configured at all make sure your interfaces file shows

Code:
iface wlan0 inet static
    address 192.168.0.3
    broadcast 192.168.0.255
    network 192.168.0.0
    gateway 192.168.0.1
Then save the changes and run ifdown wlan0 then ifup wlan0, if the changes are not reflected in the ifconfig output for interface wlan0 then I see the issue being with either the ndiswrapper or with he wifi configuration. wicd should let you see what networks are available if you see no networks then the issue is likely with your driver or ndiswrapper. Also you should check to make sure there isn't a native kernel driver for the card, or that you can' tuse another driver like the wext with the wpa_supplicant.
 
Old 08-12-2009, 02:23 PM   #12
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
then the driver isn't configured properly, you should see if there is a native kernel driver and make sure you have ndiswrapper loaded as a kernel module and that you have the appropriate windows driver to use with the ndiswrapper if you are going to/have to stay with it.
 
Old 08-12-2009, 02:23 PM   #13
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
PS does your computer see your card try running lsusb if it is a USB card.
 
Old 08-12-2009, 02:28 PM   #14
dudearcher
LQ Newbie
 
Registered: Aug 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Success!!!!! I tried starting over. Here is what I did:

Code:
ifdown wlan0
iwconfig wlan0 essid "NETGEAR"
iwconfig wlan0 mode Managed
ifup wlan0
route add default gw 192.168.0.1
It works, and I have the Internet!

Thank you very much for your help.
 
Old 08-12-2009, 02:37 PM   #15
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
You're welcome
 
  


Reply



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
Debian Etch Stable & xgl (Yeah, I know....) kterry Linux - Software 6 02-12-2009 03:52 PM
Best distro? (yeah, yeah...I know, but read on!) jiml8 Linux - Software 15 08-03-2008 08:15 AM
ICS-- wired Ubuntu 7.10 to vista over ad hoc wifi hydroscrog Linux - Wireless Networking 3 01-10-2008 08:24 PM
Sprint s720 airprime usbserial debian KNx2 Linux - Hardware 0 07-30-2007 01:38 PM
Windows ICS & ad-hoc WiFi cumptrnrd Linux - Wireless Networking 1 03-07-2006 01:05 AM

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

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