Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-22-2005, 11:02 AM
|
#1
|
Member
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95
Rep:
|
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).
|
|
|
07-22-2005, 11:56 AM
|
#2
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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.
|
|
|
07-22-2005, 01:03 PM
|
#3
|
Member
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95
Original Poster
Rep:
|
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
|
|
|
07-22-2005, 01:18 PM
|
#4
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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)
|
|
|
07-22-2005, 02:07 PM
|
#5
|
Member
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95
Original Poster
Rep:
|
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).
|
|
|
07-22-2005, 02:10 PM
|
#6
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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.
|
|
|
07-22-2005, 02:18 PM
|
#7
|
Member
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95
Original Poster
Rep:
|
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!
|
|
|
07-22-2005, 02:22 PM
|
#8
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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.
|
|
|
07-22-2005, 02:40 PM
|
#9
|
Member
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95
Original Poster
Rep:
|
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 :-)
|
|
|
07-22-2005, 02:44 PM
|
#10
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 05:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|