LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help please with 'route' (https://www.linuxquestions.org/questions/linux-newbie-8/help-please-with-route-532559/)

spindles 02-26-2007 09:41 AM

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.

alienux 02-26-2007 10:18 AM

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?

spindles 02-26-2007 10:56 AM

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.

alienux 02-26-2007 12:29 PM

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.

spindles 02-26-2007 01:40 PM

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.

alienux 02-26-2007 03:20 PM

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.


All times are GMT -5. The time now is 04:12 PM.