LinuxQuestions.org
Review your favorite Linux distribution.
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 01-07-2007, 07:20 AM   #1
windsurfer
Member
 
Registered: Mar 2006
Distribution: Ubuntu
Posts: 91

Rep: Reputation: 15
Linux does not attach to network (route?)


Hi
I have got installed Dapper Drake and I have an ether net and a wireless connection, when in the office there is a 192.168.1.x network and the router to the internet is 192.168.1.1. I use the ethernet card at work and originally I was able to connect to the router and hence the internet with ease. When I needed to go to another office I used my wireless card and connect to a 192.168.0.x network, the router for this network is 192.168.0.2. Now to my problem, When I go to remote office where I use the wireless connection I can not get to the Internet, when I try to ping the 192.168.0.2 router I get "Destination Host Unreachable" if I do a ifconfig every thing seems ok and if I ping the wireless card I get a response to it. If I try to add a route to it as below I get SIOCADDRT : File exists

sudo route add default gw 192.168.0.2 dev eth1

I am new at linux and I don't really know how to go any further. Can any one please help?

Adrian
 
Old 01-07-2007, 08:19 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Are you using DHCP or static addresses? ...in the office where networking works? ...in the office where the networking doesn't work?

Are you using the wired NIC or the wireless NIC? ...in the office where networking works? ...in the office where networking doesn't work?

I suspect that you are using the wired NIC with static addresses in the office where networking works. That would prevent your machine from automatically configuring itself on a new LAN (in the office where networking doesn't work). If that is true then the reason that the add route command doesn't work is that you have a different subnet than the one in the office where networking works. (192.168.0 vs. 192.168.1)

If you use DHCP in both offices then it seems that your machine is not being autoconfigured in the office where networking doesn't work. If that is true then find out if anyone else in that office uses DHCP for their computers. If every other machine in that building uses static addresses then the DHCP server may not be sending valid information to your computer. Some building LANs are configured to only give addresses to computers with specific hardware addresses. This is a good security measure because it makes visitors unable to get a network address when they plug into the network. This is a good thing. See if the LAN administrator in the building where networking doesn't work has restricted DHCP service to known computers and see if you can get on the list of computers authorized to recieve a DHCP address.

Check to see if you have an IP address when you issue the ifconfig command. See if the ifconfig command reports any packets transmitted and received.
Code:
eth0      Link encap:Ethernet  HWaddr 00:09:5B:BB:F1:ED
          inet addr:192.168.1.222  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:291369 errors:0 dropped:0 overruns:0 frame:0
          TX packets:162321 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:430071793 (410.1 Mb)  TX bytes:11400821 (10.8 Mb)
          Interrupt:201 Base address:0xc000
Try turning off the wireless card. Notebook computers usually/always have a physical switch somewhere on the computer case to turn the wireless circuit off. Boot the computer in both offices with the wireless NIC turned off and see what happens. This will at least help to determine what part of the system (wired or wireless NIC) you are using in the office that works.

I also noticed that your route command is applied to eth1. Most computers will start numbering ethernet cards at eth0. Also, the eth? name will USUALLY apply to wired NICS while wireless NICS will have some other name like ath0 for Atheros based wireless NICS. Of course all of this is configurable so it depends on your Linux distro and on how you or your sysadmin set your system network up.

Please give these ideas a try and report back what you find.

Last edited by stress_junkie; 01-07-2007 at 08:28 AM.
 
Old 01-07-2007, 09:51 AM   #3
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
If you donot use both of your network card & wireless link at a same time, you could follow the last post of this thread & if you do,
Code:
ip route change default gateway new-gateway-ip
would help you out.
 
Old 01-07-2007, 09:58 AM   #4
windsurfer
Member
 
Registered: Mar 2006
Distribution: Ubuntu
Posts: 91

Original Poster
Rep: Reputation: 15
Hi

Thank you for replying and I was panicing! Lets answer some of your questions, yes I am using static address in both offices, they are only small and only have 4 or 5 pcs. On the wireless network the machine has a static address 192.168.0.81. I cannot ping the router which is 192.168.0.2 but I can ping the wireless card in my pc which is ip 192.168.0.81 (Ubuntu has made this eth1). If I do an ifconfig the output looks ok (I cannot print it as I do not have access on the network! which is what I am trying to get!!!) I tried to connect the pc hard wired to the network changing the eth0 ip address to be 192.168.0.80 and turning of the eth1 card. When I did this it worked in the wireless office. So I took the hard wire away again stopping eth0 and starting up the wireless eth1. Now even though Ubuntu is showing a good signal I cannot ping the router again. So ignoring the home office (as the remote office is where I am at the moment) it appears to be the eth1 wireless connection. I redid the ifconfig and the card seems OK, still no connection though. What should I do next?
 
Old 01-07-2007, 10:51 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Okay so we're talking about getting the wireless NIC working only?

I read the thread referenced by amitsharma_26. This should work but there should be a more user friendly way to do this. I am using PCLinuxOS on my notebook computer. That is based on Mandriva so maybe, MAYBE, something from there will apply.

On my PCLinuxOS system there is a distro specific system configuration utility. It is a lot like YaST in SuSE Linux. It is very user friendly and it has a GUI interface. The system configuration utility has an applet to dynamically discover and configure wireless network connections on demand just like in Windows. It makes configuring wireless networks VERY easy. You can see a list of networks that the card can "see". It lets you put in any passwords and it will keep the configuration for a given network once it is configured.

The reason that I suggested that you check the RX and TX using ifconfig is to see if the wireless card is talking to the wireless access point at all. If it is then maybe you have to set up encryption in order to connect. If the RX packet count is above zero then it is likely that your wifi card is talking to the wireless access point but it isn't configured to establish a connection.

I would configure the home access point to provide DHCP. That will eliminate all of your routing concerns since DHCP autoconfigures routing for you.

So, use ifconfig to see if the wireless card has received any packets (RX). Hopefully you will see that it has received 5 or 6 packets. Then look to see if your distro has a system administration utility with an applet to dynamically configure and create wireless connections.

Let us know what happens.

Last edited by stress_junkie; 01-07-2007 at 10:53 AM.
 
Old 01-07-2007, 10:59 AM   #6
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Your networking configuration is contained in /etc/network/interfaces. You should configure the file for each location;

#location 1
#auto eth0
#iface eth0 inet static
#address 192.168.1.X
#gateway 192.168.1.1

#location 2
#auto eth1
#iface eth1 inet static
#address 192.168.0.81
#gateway 192.168.0.2

Now all you need to do is edit this file by removing the rems (#) for the relevant location and save it. Open a consol as root and do /etc/init.d/networking restart. I am assuming that the wireless network is working. The only caveat here is whether the system is going to still identify the wireless card as eth1 or 0. You may have to play with this as it may identify it as eth0.
You can check the configuration with ifconfig and make sure it is seeing the router by pinging it.

Last edited by TigerOC; 01-07-2007 at 11:05 AM.
 
Old 01-07-2007, 12:17 PM   #7
windsurfer
Member
 
Registered: Mar 2006
Distribution: Ubuntu
Posts: 91

Original Poster
Rep: Reputation: 15
Ok have looked at the output of ifconfig again bearing in mind what was said by stress_junkie above, when ifconfig was executed yes there were errors in the RX and TX packets, so I removed all security (WEP) and lo and behold the error count was less, but still there!! The ping to the router still did not work, also tigeroc thanks for your post will try this when I get to the other office,

What is next?
 
Old 01-07-2007, 12:53 PM   #8
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
This sounds to me like Ubuntu is still seeing the default gateway as accessed through eth0 instead of eth1.

You can check this by using the command:
Code:
jslittl@jslittl-laptop:~/mnt/secserve-home$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.0      *               255.255.0.0     U     0      0        0 eth1
default         172.16.0.1      0.0.0.0         UG    0      0        0 eth1
jslittl@jslittl-laptop:~/mnt/secserve-home$
The last column is the one that you are interested in. It should read eth1. If not that is your problem. The temporary fix to this is:
Code:
sudo route del default
sudo route add default gw 192.168.0.2 netmask 255.255.255.0 dev eth1 up
I guessed at your subnet mask so make sure that it is correct. Consult the Ubuntu networking documentation for making that permanent (or put the above in a script and run it at the remote office).

hth
 
Old 01-08-2007, 09:50 AM   #9
windsurfer
Member
 
Registered: Mar 2006
Distribution: Ubuntu
Posts: 91

Original Poster
Rep: Reputation: 15
Well guess what, when I switched on my computer this morning I got the wireless signal shown on the gnome network thing being green and strong, still can't ping my router though getting "Destination Host Unreachable", tried connecting on eth0 with a lead, I could now ping the router but no further. So from this I deduce that 1) My wireless is not connecting even without any security switched on. 2) That the router is working ok but I can't connect to my wireless network. I did try to put the latest gnome network manager and wpa-supplicant on but this seemed to do nothing. I must have done it wrong.

Doing route does not give me a default in the route table but there are 2 entries one for each network (eth0, eth1) for each device.

I do not know of what to do next. HELP!
 
Old 01-08-2007, 04:05 PM   #10
windsurfer
Member
 
Registered: Mar 2006
Distribution: Ubuntu
Posts: 91

Original Poster
Rep: Reputation: 15
So I gave up, what does it mater!! I was looking though the web at Ubuntu / wireless blogs and noticed that quite a few people were using Ubuntu Edgy, so I thought to get the latest drivers (essentially the gnome network manager which seemed to be used quite a lot) I thought I would update from Dapper to Edgy. Well after 1 1/2 hours more work it was done, easy. When I booted it up, modified my wireless network guess what, it worked (without wpa). So now I am using it, but without security!!. Does anyone now how to get wpa working? I would be grateful for any help.
 
  


Reply

Tags
cmd, route


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
uuencode doesn't attach on linux bigearsbilly Programming 1 02-10-2005 09:57 AM
For Linux GURU's: route configuration in complex network netguy2000 Linux - Networking 1 09-06-2004 10:00 AM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 03:11 PM
attach to another linux server rwalkerphl Linux - Newbie 4 07-05-2004 12:01 AM
Attach a new partition to Linux FS pbhat Linux - General 3 06-23-2004 02:04 PM


All times are GMT -5. The time now is 06:48 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration