LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Can't get home network working (https://www.linuxquestions.org/questions/linux-networking-3/cant-get-home-network-working-398794/)

Justbill 01-02-2006 06:19 PM

Can't get home network working
 
I have been doing a TREMENDOUS amount of reading on this subject the last couple of weeks, and have really gotten nowhere!
I have 2 computers sharing an internet connection on a Belkin F5D5231-4 router. This is a hard wired network. When I first connected the computers to the router, they were both able to connect to the internet with no problem. I then tried to print something, and found that I had change my printer settings on box 1, that has the locally connected printer. I had to change to a "shared" printer. This led to believe that the 2 machines were "seeing" each other. To try to make this long story painfully short, I have changed the "Hostname" and "Domainname" on each computer, I have tried to set the IP addresses (in Network Configuration ), but when I change them, I lose my internet connection. The primary DNS is 192.168.2.1 . There is no secondary. I tried to ping each computer using the hostname, but that came back "unknown Host". Am I asking to much of my router here? I'm hoping there is a way to do this. Here are my specs:

Box1
dual booting Win. XP & Fedora Core 4
Compaq Presario SR1426NX
2.93GHz Pentium 4
512MB PC2-3200 DDR2 SDRAM
160GB 7200RPM Serial ATA hard drive

Box2
dual booting Win. 98 & Centos 4.2
HP Pavilion
500MHz Celeron
256MB RAM
80GB hard drive

My router, as I said earlier, is a , Belkin F5D5231-4 router.

I think I am almost there with this, I just seem to missing something here, and I believe what I am not entirely understanding is the whole IP address thing. I've been trying to get things started with this
tutorial, but I think the problem is that I have a router, and he is using a crossover cable. I just don't know!
Any Help would be greatly appreciated

Thanks
Justbill

halvy 01-03-2006 12:30 AM

i wouldn't use my router as a dns server too.. but thats just me.

ruuster 01-03-2006 02:21 AM

You may want to start at the beginning. You know, "I am building a home network with the purpose of creating a ......... I need to run a DNS in this private space even though I have only 2 host systems because ........."

I am very curious why you are running a DNS. Are you hosting something like a web server that Internet clients can connect to?

Justbill 01-03-2006 06:11 AM

O.K. So maybe I'm on the wrong track here. All I want to do is file share between the two machines, and be able to use the printer, that is locally connected to box1 (usb), from box2. I guess I've mis-understood what I've been reading, I thought I had to do it through DNS. I guess my first mistake here was the "I thought" :-)

Thanks
Justbill

Poetics 01-03-2006 07:50 AM

DNS has almost nothing to do with file/print sharing. To share files between Windows & Linux boxes you'll look up a program called Samba. Samba will also allow you to share the printer.

kbuk 01-03-2006 08:33 AM

By the sound of it the router is at 192.168.2.1 ( it's the default gateway if you use dhcp).

If you can set the ip addresses to be static, that will be easier for you. That could either be using the mac address to set a static address on the router, or manually assigning the address (but then you'll need to do gateway, dns server etc.

There are 2 different ways of sharing the printer. CIFS/SMB with Samba & Windows or unix / linux with lpr (or similar).

If the one with the printer mainly runs windows then you're probably best with samba.
When it's running windows you'll need to share it under samba. Then the 2nd computer will print using samba no matter if the first is windows or linux.

If the pc with the printer has a static ip, then it will be easier

halvy 01-03-2006 10:45 AM

if you use a static addy, just make sure it is on a seperate nic card than the one you use to acess the router (net).

you need dhcp on for that nic connection... or you'll have no internet.

bdogg 01-03-2006 10:47 AM

he has a belkin router... There is nothing wrong with disabling the DHCP option on that belkin and assigning static addresses to all of the host computers (on the nics he connects to the router), there will still be internet.

Justbill 01-03-2006 12:35 PM

I think I need to clear something up here! We have Windows on both these machines, but never really boot Windows. We use our linux OS's, almost exclusively! I would like to have the 2 machines be able to fileshare, and be able to print from box2, to the printer locally connected (HP 1315psc usb) on box1. I tried using NFS, and so far have been unsuccesful. I have tried to ping box2 from box1 and visa versa, with no success! So, if some one can point me in the right direction here, weather it be a tutorial, or different hardware, or whatever, it would be greatly appreciated. Currently (and this may be the problem, I just don't know) I have 1 ethernet card in each computer, both connecting to the router, is this where I begin? But I am not trying to communicate Linux to Windows, I am trying to communicate Linux to Linux (FC4 to CentOS 4.2)

Thanks
Justbill
afterthought: My internet connection is broadband (cable)

cuiq 01-03-2006 12:53 PM

I use a four port printer switch, cost me $12 at tiger direct. It's usb and I just press a button for which ever computer I want to print from. This works because my computers are not that far from each other and we don't really do a whole lot of printing. Of course this may not be ideal if you have one computer upstairs and there is nobody to push the button for you :lol:

Just a thought.

ruuster 01-03-2006 02:43 PM

Can't ping? OK, DNS, DHCP, Samba, Windows, etc. all goes to the back burner. You have a very basic network issue.

Are both hosts connected to the Belkin router, either directly or through a switch or hub?

If you are using a switch or hub, is it connected to the router? Links?

Can you ping the router from either host?

Do both systems have the interfaces up with IP addresses? (ifconfig -a on both systems)

Do you have link leds lit on the NICs and the ethernet interfaces in the router, switch, or hub?

kbuk 01-03-2006 03:40 PM

Note to halvy and bdogg, I said nothing about disabling DHCP, that's still very useful when additional pc's are connected (if ever, eg someone visiting with a laptop). This issue was either restricting the DHCP pool to less than the entire /24 OR entering the MAC addresses so the router assignes them the same address every time.

But to the point at hand As ruuster states, there are some VERY BASIC network issues here.
Are the all the computers plugged in, switched on and have network cables connecting them.
Do the nics / ports on the router have link lights?

Do you know the ip addresses of each computer

Justbill 01-03-2006 05:45 PM

OK, I'm going to do the best I can here. I am no guru by any means, so go easy on me guys!:)
First off, both computers are directly connected to the Belkin (4port) router. The lights on the router are on , on port 1 & 2. The lights are on, on the ethernet cards, in each computer. There is no hub or switch, they plug directly into the router. Box1 is on port 1, and Box2 is on port 2. So far I have only been able to ping 127.0.0.1 , from either computer. I am not sure how I would ping the router, except to type in "ping Belkin", or "ping router", which I have tried, and the response was "unknown host". I also tried to ping each computer using the host&domain name, and got the same response, "unknown host". I typed in ifconfig -a , and got "command not found". I thought the 192.168.2.1 was the address, so I guess the answer would be no, to the do you know the IP address of each computer. How would I find them out? Both computers have successfully been accessing the internet with no problem. So, if this is a very basic networking issue, I guess what I need to do is start from scratch here and simply ask, what do I do?

Thanks Much
Justbill

michaelk 01-03-2006 05:45 PM

How are the computers presently configured, static or dynamic IP address?
Can you ping the router by IP address?
Can you ping the other computer using its IP address?

If configured using a static IP address then the /etc/resolv.conf file is not being updated from the router. This DNS nameserver data from the router is just for the internet and not your local network. Which is the reason you can not ping your computers by their hostname.

With 2 computers the simplest and quickest solution would be to use static IP addresses and add an entry to the /etc/hosts file with the IP address and hostname of each computer. The will resolve IP address to hostname without using DNS. You will also need to update the /etc/resolv.conf file to add the nameserver info from the router.

michaelk 01-03-2006 05:51 PM

It appears that your PCs are configured for dynamic IP address.
To find out the IP address of your PC type in a console window:
/sbin/ifconfig eth0

The router's manual should show its default IP address. But I would guess it to be
xxx.xxx.xxx.1 from the results of the output of ifconfig command. xxx being the same as your IP address.

According to the documentation I have found the default IP address is
192.168.2.1.

Also posting the results of the console command route will indicate the default gateway for the PC. Look for the line that has a UG. This will be the IP address of the router.


All times are GMT -5. The time now is 04:19 AM.