Solved

Internet connection in Linux

Posted on 2004-04-17
19
720 Views
Last Modified: 2013-12-06
I am trying to completely ditch Windows and switch to Linux, but I am having problems trying to connect to the internet in Linux. First, here's what I have...

Toshiba Satellite A45-S250 - has a built-in Ethernet connection and Atheros Wireless Lan connection. I have a cable internet connection with a Linksys cable modem that is connected to a Linksys Wireless router - I am currently accessing the internet through the wireless router connection.

I can connect fine on Windows both on the wireless connection and the Ethernet connection, but I can't do either within Linux. I downloaded Fedora Core and tried setting up the Ethernet connection, but it kept telling me it couldn't activate the "eth0" connection, and didn't even acknowledge the existence of the wireless connection. Today I bought SuSe 9.0 and installed it. It does recognize both the Ethernet and wireless connections, but I can't do anything with them - it keeps saying it can't find any network. Is there just some obvious (obvious to an expert at least...) step I'm missing - a way to tell the system which network connection to use?
0
Comment
Question by:beaker67
  • 9
  • 9
19 Comments
 
LVL 1

Expert Comment

by:SciGuy
Comment Utility
are your interfaces picking up the right IP addresses (assuming you're using DHCP)

/sbin/ifconfig

will tell you your ip addresses. If those are right, maybe you have a routing problem. Run /sbin/route to see the static routing tables. you should see a 'default' entry pointing to your gateway (i.e. your router). if not run:

/sbin/route add default gw <ip> <intf>

where <ip> is ip address of gateway (i.e. router). and <intf> is the interface u want to use by default (i.e. eth0).
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
Start up YaST2 and select the network configuration. For your wireless connection you may have to add WEP information (I hope you did enable WEP encryption on your access point!)
There is no need to manually specify routes or IP addresses (you would have to do this everytime you boot your machine). You can specify all this information in YaST2 and it will get applied at boot time.
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
Already tried changing various settings in Yast several times - even disabled WEP encrption to see if that might have been causing problems - nothing. I ran "KWifiManager" which says it can't find any wireless networks nearby.

I just tried "/sbin/route add default..." and it says "network unreachable".
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
What's the output of /sbin/ifconfig?
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
linux:~ # /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:08:0D:31:71:F3
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::208:dff:fe31:71f3/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:56729 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:81291884 (77.5 Mb)  TX bytes:2643507 (2.5 Mb)
          Interrupt:11 Base address:0xcf40 Memory:cffef000-cffef038
 
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:4570 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4570 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:294927 (288.0 Kb)  TX bytes:294927 (288.0 Kb)
 
wlan0     Link encap:Ethernet  HWaddr 00:90:96:85:65:86
          inet6 addr: fe80::290:96ff:fe85:6586/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1002 errors:2052503 dropped:0 overruns:0 frame:13133
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:199
          RX bytes:78507 (76.6 Kb)  TX bytes:6250 (6.1 Kb)
          Interrupt:11 Memory:e0a48000-e0a58000
 
Obviously, the Ethernet connection now works. I don't really know why - maybe it's because I connected it to an access point on the wireless router rather than directly to the cable modem. The wireless connection still doesn't do anything though.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
As you can see from the ifconfig output, your wireless device wlan0 is not correctly configured. Eth0 does have an IP address (192.168.1.101). This shows that your machine did connect to your DHCP server and did receive an address (I assume that you did not manually configure this address).
Was the wireless interface correctly identified in YaST2?
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
Yes, YaST does see "wlan0" and describes it (Network Card ---> wlan0 ---> Hardware Settings) under "module name" as an "ath_pci", which is accurate because it is in fact an Atheros mini-PCI card.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
Did you enter the correct information in YaST2's "Wireless Device Settings"?
Are you sure your access point does accept connections from the mac address of your WiFi card?
Did you specify the key in the correct format (hex vs. string)?
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
Yes, I did enter the right information in YaST...at least I'm pretty sure I did...do I need anything in the "Nick Name" field?

The access point does accept connections perfectly from my wireless card because it works fine in Windows.

Yes, the key is in hex.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:beaker67
Comment Utility
Also, I don't know if this might have anything to do with the problem or help solve it...

When I boot up Linux, it says it eth0 can't find an IP address (and the network cable is plugged in even before I power on the computer) but it works fine when I am logged on and try to use it.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
You don't need anything in the Nick Name field.

Run this command:

/usr/sbin/iwconfig
This should list all your network devices and indicate which one does have the wireless extensions enabled (should be wlan0).

Then try to set the features manually:

/usr/sbin/iwconfig wlan0 mode Managed
/usr/sbin/iwconfig wlan0 essid your_network_essid
/usr/sbin/iwconfig wlan0 key 00010203040506070...

(Use your own hex key).

Does this change anything? If not, try this:
/usr/sbin/iwconfig wlan0 key restricted 000102030405...

or this:
/usr/sbin/iwconfig wlan0 key open 0001020304050607...

0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
No, those didn't change anything. Earlier, I tried disabling WEP, and it worked - sort of. KWifiManager (used that because I didn't know the terminal command) reported that it was connected to the network, and correctly identified the MAC address of my wireless router, but it still said "AccessPoint: UNKNOWN". Then when I try to do anything on the Internet it didn't find anything - kept timing out and saying it couldn't find the web servers. I re-enabled WEP, and it kept (sort of) working. So, now it seems to be connected to my network, but not to the Internet.

I checked to make sure I have the right WEP key - I even experimented by typing in a completely wrong key (123456890) - when I did that wlan0 disappeared entirely (when I ran /sbin/route). It reappeared when I changed it to the correct key.

BTW, I've noticed that whenever I start the computer without the ethernet cable plugged in, /sbin/route reports the wlan0 is the only connection but there is no default gateway. The minute I plug the ethernet cable in, it automatically adds itself as the default - is there any reason why this would not happen with the wireless? I've even tried manually adding wlan0 as a default AND removing the eth0 default - still nothing.

Sorry if I'm causing headaches for you, but I would really like to get this wireless working so I'm not tied down to an Ethernet cord :-)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
No headaches yet :-) At least not caused by your problem.

Are your two network interfaces on different subnets? I know that my Mac supports this - it will use the "wired" network if it's available, and otherwise will use the WLAN. I'm not sure if this can work with Linux at all (it needs a lot more logic than what your standard distribution gives you).

Does your AP have an IP address? If not, then your router does have an IP address for sure. Try to ping either the AP or the router (ping 192.168.xxx.yyy). Does this work?

What does /sbin/route -n print when the WLAN is active?
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
I don't have any idea what a subnet is.

My AP IS my router, and it does have an IP address. I tried pinging it - nothing.

When wlan is active...

linux:~ # /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

Doesn't exactly help to reduce the confusion when eth0 can't find an IP address at startup but wlan0 can, yet eth0 connects to the internet and wlan0 doesn't...
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 250 total points
Comment Utility
This is your problem: Both interfaces are on the 192.168.1.0 subnet, this means that your system cannot "decide" which interface to use. When you use Windows, do you also have both interfaces connected?
You could reconfigure eth0 to use a hardcoded IP address in a different subnet (e.g. 192.168.2.1), or you could shut it down completely:
ifconfig eth0 down

Does this make a difference? will have to add a new default route:

route add default gw 192.168.1.1
(this should now show the interface wlan0 in the last line of the route -n output.
Try to ping your AP now.
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
Hmmm...

When I'm in Windows I only have the wireless connection up - I leave the ethernet connection disabled because I don't need it. But I just tried having both enabled, and it works fine - it can just disconnect one and reconnect the other whenever I want, and Windows automatically detects this and uses one of them.

I disabled eth0, but that isn't helping anything - the wlan is still connecting to the AP but that's it. What's weird is it sees the access point - it gives the right MAC address - but it won't let me ping it or do anything else.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
Did you set the default route after disabling eth0? Does route -n now show wlan0 as the interface for the default route? If you don't know what this means, please post the output of route -n again.
0
 
LVL 2

Author Comment

by:beaker67
Comment Utility
I disabled eth0, rebooted, and can access the internet with wireless. Thanks for your help!
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
I'm pretty sure it was the default route that tried to direct any packets to your eth0 interface (which was either not connected, or disabled), therefore the data never made it to the router.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now