Link to home
Start Free TrialLog in
Avatar of beaker67
beaker67

asked on

Internet connection in Linux

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?
Avatar of SciGuy
SciGuy

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).
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.
Avatar of beaker67

ASKER

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".
What's the output of /sbin/ifconfig?
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.
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?
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.
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)?
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.
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.
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...

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 :-)
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?
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...
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
I disabled eth0, rebooted, and can access the internet with wireless. Thanks for your help!
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.