LinuxQuestions.org
Help answer threads with 0 replies.
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 07-22-2005, 11:02 AM   #1
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Rep: Reputation: 17
Accessing other machines on same router


I found a few threads that hit all around my problem, but none right on point. So will go ahead and ask it, even though I feel sure it has been asked before. I have several machines, all connected to a router, which is in turn connected to a cable modem. Some machines run only Windows XP, while others can run either Windows XP or Linux. I have Fedora Core 4 on this machine and RH9 on two of the other machines. All machines, both with Windows and Linux, are set up to obtain an IP address from the router, using DHCP. (I presume that it would be correct to say the router acts as a DHCP server). The router is IP address 192.168.1.1, and assigns IP addresses to the machines in the range 192.168.1.100 on up. Everything works fine, all machines can connect to the Internet. The Windows machine can exchange files (I used the Network Wizard to set them up). But Linux is another story. No Linux machine can ping or otherwise connect to any other Linux machine using hostname. (For simplicity, I'll confine the rest of this to only two Linux machines.) Doing /sbin/ifconfig gives me the IP address that the router assigned (only when they logged into the Internet, though) and other presumably good stuff. I can ping each from the other, using that IP address. But I cannot ping using the hostname. Now, I fully realize that life is a lot simplier using static IP addresses. But my router is set up for DHCP, and although in theory that can be changed, in practice if I try to change it and mess up my wife's access to the Internet then I am in deep trouble! So I'd prefer to stay with DHCP. Given that, how can I solve the problem. (The problem is not really being unable to ping -- I need to set up file sharing using NFS and am going to have to use host names to do that).
 
Old 07-22-2005, 11:56 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Do 'route' and post the output. However, I think I may know the problem.
My route output looks like:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
(Obviously, my network uses the 192.168.0.0/255.255.255.0 network, so substitue a .1 for my .0 in the 3rd position)

If you lack the line that starts with a network address (in my case, 192.168.0.0), you probably need:
Code:
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0
Where eth0 is the interface connected to the router.

Last edited by Matir; 07-22-2005 at 11:57 AM.
 
Old 07-22-2005, 01:03 PM   #3
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
DESTINATION GATEWAY GENMASK FLAGS METIC REF USE IFACE

192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
Default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
 
Old 07-22-2005, 01:18 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You know, I completely misread part of your original post. Sorry.

How are hostnames set up? Do you just mean the hostname provided in /etc/hostname? You'd need a DNS server (or a dhcp server that provides DNS services) on the network to take advantage of name->ip mapping. (Or /etc/hosts files, but those require the IPs to be static)
 
Old 07-22-2005, 02:07 PM   #5
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Well, it was a long post. I should have broken it down into paragraphs, I supposed, to make it easier to read. :-)

Yes, I just used the hostname command to set up the hostname. (hostname xp.MSHOME, for example).
 
Old 07-22-2005, 02:10 PM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Just using the hostname command will not make it accessible to other computers by that name. The hostname command basically says "this is the name you should know yourself as." You still have to tell other computers what to call it by. Unfortunately, with DHCP from a router (assuming a 'thin' router: i.e., linksys) this is not so easy. With a linux router, you could just slap dnsmasq on there and be done.
 
Old 07-22-2005, 02:18 PM   #7
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Well, I'm going to try mixing static IP's and see what harm that does. That is, I will use the network configuration tool and add to the /etc/hosts file with that tool, static IP's (which I will just make up, in the range of 192.168.1.200 up). After all, there HAS to be a way to make it work with the router because Windows XP makes it work!
 
Old 07-22-2005, 02:22 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If you're going to use static ips in there, use them in a range that DHCP will never assign. For example, if you want to use 192.168.1.200+, then set the router to do DHCP on 192.168.1.100-192.168.1.199. If two computers do get the same IP (which is possible with less than 100 computers due to how most of those routers work), you will have no end of headaches until you pull the plug on one.
 
Old 07-22-2005, 02:40 PM   #9
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
I only have five computers, and have noticed that the router always just starts at 192.168.1.100, then increments by 1, etc. So the highest IP ever assigned (from my observations so far) is 192.168.1.104. That is why I started the static IP addresses with 192.168.1.200, which should not cause any conflict. (I hope :-)
 
Old 07-22-2005, 02:44 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You *SHOULD* be okay, but I've seen a router that would go through it's whole available range before restarting, like so.

Computer 1 gets .100
Computer 2 gets .101
Computer 1 gets rebooted, receives .102
Computer 2 gets rebooted, receives .103
...
Computer 1 gets rebooted, receives .254
Computer 2 gets rebooted, receives .100
 
  


Reply


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
Accessing Networked machines vishalsethia Linux - Newbie 14 05-25-2005 01:57 AM
two machines, one router, no connection blue.spark Linux - Networking 2 04-14-2005 03:26 AM
dnsmasq for accessing lan machines from outside netgear router? aaronvegh Linux - Networking 0 08-11-2004 02:04 PM
Accessing Windows Machines Problem Help!! Sabeer Linux - Networking 1 10-29-2003 10:13 AM
Accessing Windows Machines from Mandrake 9.1 tminus Mandriva 4 09-05-2003 11:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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