LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 02-26-2007, 09:41 AM   #1
spindles
Member
 
Registered: May 2005
Location: New Zealand
Distribution: Now Ubuntu 16.04
Posts: 154

Rep: Reputation: 15
help please with 'route'


Can anyone confirm that this output from route (below) is wrong?

Seems to me my previous routing info might have gone back to un-set or default values since a couple of recent re-sets. (I may have had some overheating in the last few days.)

After using Linux for a couple of years now I am biting the bullet and trying to understand more about how to set up Samba and networking properly. (Previously I just let Yast arrange everything.)

BTW
I can ping 127.0.0.1 ok
I can ping my router/gateway ok, at 192.168.1.2
I cannot ping my server/host:
PING 192.168.2.22 (192.168.2.22) 56(84) bytes of data.
From 210.48.12.64: icmp_seq=1 Destination Host Unreachable


# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.2 0.0.0.0 UG 0 0 0 eth0

I am wondering,
Is 192.168.1.0 supposed to be there.

Should there actually BE some ip addresses where those asterisks are?

I think I understand from the man page HOW to add something to the route tables, but I couldn't understand for sure WHAT to add.

E.g. it seems to me I would NOT want to just add my current server/host/machine ip, because it's only on lease for a limited time.

Any help gratefully appreciated.
 
Old 02-26-2007, 10:18 AM   #2
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
If your server's IP address is 192.168.2.22, that indicates that it is on a separate subnet. If this is the case, is the router at 192.168.1.2 physically connected to the 192.168.2.0 subnet through one of its interfaces?
 
Old 02-26-2007, 10:56 AM   #3
spindles
Member
 
Registered: May 2005
Location: New Zealand
Distribution: Now Ubuntu 16.04
Posts: 154

Original Poster
Rep: Reputation: 15
Hi alienux

I don't really understand your question.
My linux machine is connected with a network cable to my router/modem/gateway, which is 192.168.1.2.

according to what I understand of ifconfig, my NIC, eth0 on this box seems to be configured okay.

So my linux box/samba server IP address is 192.168.2.22.

I thought that address was just leased out by the router, just like these other ones on the XP boxes:

smbtree gives me:
My computers that use XP:
Got a positive name query response from 192.168.1.62 ( 192.168.1.62 )
(shows the shared directories)
Got a positive name query response from 192.168.1.188 ( 192.168.1.188 )
(shows the shared directories)
AND
error connecting to 192.168.2.22:139 (No route to host)
error connecting to 192.168.2.22:445 (No route to host)

As you can see, I am pretty new at Samba.
I don't even really know what you mean by 'subnet'.
But in the troubleshooting info I have seen the first step is to check that we can ping the gateway, the loopback and the server.
 
Old 02-26-2007, 12:29 PM   #4
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
192.168.1.x and 192.168.2.x are different subnets. Because of routing rules, they can't communicate without some sort of router between them. This means a server running routing services with multiple network cards, one per subnet, or an actual router that is connected to multiple subnets (this could also be accomplished with VLANS, but that probably doesn't relate to this issue).

What that means is that unless you have some type of routing device between these computers, they can't talk to each other. This would mean an actual routing device, not just multiple LAN ports on a router that are on the same subnet (this is typically how the Linksys, NetGear broadband routers work).

If your router's IP address is 192.168.1.2, and it is a DHCP server for the 192.168.1.x subnet, but does not have an interface configured for and connected to a subnet configured as 192.168.2.x, it should not be giving out DHCP addresses for the 192.168.2.x subnet.

Without more information, I would guess that the 192.168.2.22 address was configured statically, and was given an incorrect IP address. It likely should be 192.168.1.22. This is all based on assumptions that you have a single retail router that only has a single internal interface with multiple LAN ports on that interface. If this is not the case, there are other possibilities.

Is the server with the 192.168.2.22 address able to ping 192.168.1.2? The answer to that question will help paint a little bit better picture of the network itself.
 
Old 02-26-2007, 01:40 PM   #5
spindles
Member
 
Registered: May 2005
Location: New Zealand
Distribution: Now Ubuntu 16.04
Posts: 154

Original Poster
Rep: Reputation: 15
Thanks for your help.

Yes, it's just a cheap retail 4-port adsl modem/router.

Well, I have to say, I have absolutely NO idea why the address 192.168.2.x came to exist. Just a default setting maybe?

How did I "set up" (using the term loosely) the network?

I was using Samba, just the client, for about a year.
Then one day I thought I would share one of the folders on this linux machine.

I probably used Konqueror, right-clicked on a folder, and clicked on 'share' in the menu just to see what would happen.

If I did anything more than that it was probably just to let Yast set up a Samba server. I probably let Yast auto-detect and clicked 'accept' for any suggestions it gave me.

I have to say I have used this approach with Suse for anything I don't properly understand -- just let Yast have a go at it and see if it works.
(I am not being lazy in doing this -- I have also spent hundreds of hours learning about other aspects of the Nix Way. But I will certainly take 'works out of the box' when it's available.)


Since then I have made some settings that seemed necessary in smb.conf.

Here are some main entries:
___________
smb.conf
[global]
workgroup = MSHOME
interfaces = 127.0.0.1 eth0
bind interfaces only = true
security = user
server string = Samba Server
add machine script =
domain master = false
dns proxy = no
netbios name = mugwump
___________

So I take it that now 'mugwump' is the name of my machine, the 'hostname' for this machine, and also the name of the Samba Server here.

The name seems properly identified with the ip address (but can't be pinged):
# ping -c 2 mugwump
PING mugwump.localhost (192.168.2.22) 56(84) bytes of data.
From loopback4770.core6a-akl.iconz.net.nz (210.48.12.64): icmp_seq=1 Destination Host Unreachable

And I can ping almost anything from this machine (except itself), I can use the internet etc:

# ping -c 2 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.690 ms

# ping -c 2 google.com
PING google.com (64.233.187.99) 56(84) bytes of data.
64 bytes from jc-in-f99.google.com (64.233.187.99): icmp_seq=1 ttl=244 time=269 ms

I expect you are right when you say that the 192.167.2.x address doesn't belong here. But how did it get there? -- by some default I suppose.
And do you know how I would or should change it?

Thanks again for your help.
 
Old 02-26-2007, 03:20 PM   #6
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
It's been quite awhile since I used SuSe, and I typically use the command line to configure network settings, and I don't remember exactly where to change them in SuSe. I do remember that the network config files were in different locations than the other distributions I use (Slackware, Fedora, and PCLinuxOS), but I'm sure you can change network settings in YaST.
 
  


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
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
if a route fails in a multipath route? eantoranz Linux - Networking 5 07-03-2005 02:03 PM
ADSL as a Alternate route or backup route bhagat2000 Linux - Networking 0 05-27-2004 03:17 PM
Working with 'route' and unwanted route entries pioniere Linux - Networking 6 02-05-2003 12:14 PM

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

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