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 08-04-2006, 01:05 PM   #1
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Rep: Reputation: 15
home networking with D-Link DI-604 router


It's been two entire days I'm failing miserably at setting up a simple 2-PC home network with this router. I'm using two Debian GNU/Linux PCs that I want to connect together and have a broadband cable access. What went fine:

1. Logging into the router by browsing into 192.168.0.1 and setting up admin password

This went pretty much according to the manufacturer's instructions (mind you, all for M$ users). I provided the admin password, changed the time zone details, and the router restarted after exiting the wizard. Of course, I only did this at one of the computers.

2. Access to the internet is OK at both PCs.

Although, there seems to be a small reduction in speed.

3. IP addresses assigned.

Each computer was given 192.168.0.100 and 192.168.0.101 as IP addresses, with the common gateway 192.168.0.1, which to me makes sense: the router address is unique, but the internal network terminals each have a unique one.


Now, what went awry:

1. Clicking on "clone MAC address" at the wizard as instructed, disabled access to the internet at both computers.

I had to reset the router to get everything back to normal.

2. Trying to access each computer from the other fails.

I typed the other computer's IP address to try to access it, but the message says:

Code:
An error occurred while loading http://192.168.0.101:
Could not connect to host 192.168.0.101.
One of the computers is connecting using eth0 and the other eth1 (as it apparently has both firewire and a 10/100 fast ethernet ethernet; the latter is the one actually plugged in).

I'd highly appreciate some feedback or pointers to some documentation, as I'm very stuck. Thanks in advance.
 
Old 08-04-2006, 01:11 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by patitoconejita
Now, what went awry:

1. Clicking on "clone MAC address" at the wizard as instructed, disabled access to the internet at both computers.

I had to reset the router to get everything back to normal.

2. Trying to access each computer from the other fails.

I typed the other computer's IP address to try to access it, but the message says:

Code:
An error occurred while loading http://192.168.0.101:
Could not connect to host 192.168.0.101.
One of the computers is connecting using eth0 and the other eth1 (as it apparently has both firewire and a 10/100 fast ethernet ethernet; the latter is the one actually plugged in).

I'd highly appreciate some feedback or pointers to some documentation, as I'm very stuck. Thanks in advance.
1. If you have internet access already working, you don't need to clone the MAC address. That is a feature that basically lets your router pretend it is one of your computers. It is only necessary if your ISP requires you to register your MAC address and the address you registered was the one for your computer before you added the router. So I would leave that alone if everything is already working and let the router use its own MAC.

2. You can't access each computer by using http://192.168.0.101 unless it has a webserver. Using http:// is a sign to your computer to try to access port 80, which is reserved for webservers. If you want to see if the two computers are connected, try using from the command line ping -c 3 192.168.0.101. If the default firewall allows, the machine will respond.

If you want to share files, look into installing/configuring Samba or an FTP server.
 
Old 08-04-2006, 01:28 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,678

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Futhermore:
Each PC on your network must have an unique IP address.

What do you want to do with your network?
nfs is used for filesharing between linux/unix PCs.
samba is used for file and printer sharing between linux/windows PCs.
 
Old 08-04-2006, 01:29 PM   #4
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
That was very useful, now I'm sure both computers are in touch:

,-----[ ping -c 3 192.168.0.101 ]
| PING 192.168.0.101 (192.168.0.101) 56(84) bytes of data.
| 64 bytes from 192.168.0.101: icmp_seq=1 ttl=64 time=3.49 ms
| 64 bytes from 192.168.0.101: icmp_seq=2 ttl=64 time=0.135 ms
| 64 bytes from 192.168.0.101: icmp_seq=3 ttl=64 time=0.137 ms
|
| --- 192.168.0.101 ping statistics ---
| 3 packets transmitted, 3 received, 0% packet loss, time 2003ms
| rtt min/avg/max/mdev = 0.135/1.254/3.491/1.581 ms
`-----


This shows how much I know about networking! So IIUC, if I want to share
files between these GNU/Linux computers, I need to configure Samba or
servers of some sort (ftp, http, etc.) at both ends? I thought Samba was
only for hooking Windows computers to GNU/Linux, but I may need to learn
more about this.

Thanks a lot for your help,
 
Old 08-04-2006, 01:37 PM   #5
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by michaelk
Futhermore:
Each PC on your network must have an unique IP address.

What do you want to do with your network?
nfs is used for filesharing between linux/unix PCs.
samba is used for file and printer sharing between linux/windows PCs.
I'd like to have both computers running webservers that will serve 1 or 2
websites each, so my next challenge seems to be to allow access from the
outside world to each of computers' port 80, as you pointed out. The
other thing I'd like to do is be able to share files back and forth
between both systems. If I follow you, would installing Samba at both
ends and setting up the webservers at each allow me to do these things?

Thanks again,
 
Old 08-04-2006, 01:38 PM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
As michaelk stated, you could also use NFS for linux to linux file sharing. I haven't ever actually used this, but it's probably easier than Samba since it's native. Samba is actually just an implementation of the file sharing protocol that was adopted (bastardized?) by Microsoft for Windows networking. The original protocol was OS neutral, IIRC.

For security reasons, typically you have to enable file sharing on linux through either Samba, NFS, or something like an FTP server (you could also use scp to copy files over ssh, but I digress). You can't really transfer files over http, as that's strictly a web server. Although I guess you could just save the files to disk or something...

Anyway, you need to setup one or several of these protocols. If you want a Network Neighborhood type feel, I'd use NFS or Samba. If you don't mind opening up an FTP client and using FTP that works well also. If you're not afraid of the commandline, scp over ssh is pretty quick and easy...
 
Old 08-04-2006, 01:41 PM   #7
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by patitoconejita

[...]

If I follow you, would installing Samba at both
ends and setting up the webservers at each allow me to do these things?

Thanks again,

Based on your later post, it seems it should be nfs, rather than Samba, as
both computers are running GNU/Linux.
 
Old 08-04-2006, 01:43 PM   #8
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by patitoconejita
I'd like to have both computers running webservers that will serve 1 or 2
websites each, so my next challenge seems to be to allow access from the
outside world to each of computers' port 80, as you pointed out.
That will be a problem from the outside world because there is only one IP from the outside; the IP of your router. What you can do is route that port 80 to one machine's port 80. The other machine would have to use a non-standard port like 8080 and then people would have to do http://IPofyourrouter:8080 to access the second machine's pages. Or you could host all the pages on one machine and use a simple index page that the visitor could select which website they want to see.

Note that your ISP probably forbids you from hosting any servers at your house. They probably gave you a token 5MB's or something for your use on their servers. If it's a low traffic website you might get away with it. If your ISP finds out, you could have your service terminated...

Also, from the outside world, your IP address for the router might change from time to time. So you'll need to register somewhere with dynamic DNS service. Also, having the server inside your home network is a security risk, usually you keep it in a DMZ (demilitarized zone) that has a separate subnet from your network.

anwyay, just some things to think about...
 
Old 08-04-2006, 01:54 PM   #9
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
Excellent guys, I understand this much better now. I knew about the issue
with my ISP not liking my webserving, but have gotten away in the past
(when I was plugged directly to the cable with a single computer) as this
is just a personal website with very little (less than 20 visits/month)
traffic. Anyway, according to the router's manual, it seems possible to
route requests for port 80 to some particular IP. But my priority now is
to be able to share files between both home computers. Thanks a lot.

Cheers,
 
Old 08-04-2006, 05:15 PM   #10
psychobyte
Member
 
Registered: Sep 2003
Location: Central Coast, California
Posts: 179

Rep: Reputation: 30
Another alternative to file sharing is to simply use ssh. The later distros let you 'map' drives via ssh.

or you could use SSHFS. If you setup your router correctly, this would let you share files from the outside using an encrypted protocol.

If only local access is necessary, NFS is the way to go.
 
Old 08-04-2006, 08:41 PM   #11
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
I installed the nfs-kernel-server Debian package and did some reading at:

http://nfs.sourceforge.net/nfs-howto/

which was very informative, but it seems I'm lacking background on IP
addresses and TCP. As I understand, there are 3 files that need to be set
up: /etc/exports , /etc/hosts.deny , and /etc/hosts.allow. I went ahead
and started writing the first one (most important one) using a very handy
way to specify a range of computers that might get hooked up to the router
(it has 4 ports). So I wrote this in /etc/exports of both computers:

Code:
/home 192.168.0.2/255.255.255.0(rw)
because according to the manual the router itself is 192.168.0.1 and the
computers can take number between 2 and 254. Next, I wrote
/etc/hosts.deny of both PCs:

Code:
portmap: ALL
lockd: ALL
mountd: ALL
rquotad: ALL
statd: ALL
again, as suggested in the link above. And finally, /etc/hosts.allow:

Code:
portmap: 192.168.0.2/255.255.255.0
lockd: 192.168.0.2/255.255.255.0
rquotad: 192.168.0.2/255.255.255.0
mountd: 192.168.0.2/255.255.255.0
statd: 192.168.0.2/255.255.255.0
and checked this (their suggested
Code:
rpcinfo quota
command
doesn't work):

Code:
$ rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100021    1   udp  32768  nlockmgr
    100021    3   udp  32768  nlockmgr
    100021    4   udp  32768  nlockmgr
    100021    1   tcp  34172  nlockmgr
    100021    3   tcp  34172  nlockmgr
    100021    4   tcp  34172  nlockmgr
    100005    1   udp    620  mountd
    100005    1   tcp    623  mountd
    100005    2   udp    620  mountd
    100005    2   tcp    623  mountd
    100005    3   udp    620  mountd
    100005    3   tcp    623  mountd
    100024    1   udp  32770  status
    100024    1   tcp  55964  status
to make sure the portmapper is there, then did
Code:
exportfs -ra
to reread the config files. And then the turn-off from the 192.168.0.100
machine:

Code:
$ mount 192.168.0.101:/home /home/helg/tmp/
mount to NFS server '192.168.0.101' failed.
Any ideas where this is wrong? Thank you.
 
Old 08-04-2006, 10:33 PM   #12
patitoconejita
Member
 
Registered: Nov 2004
Location: Winnipeg, MB
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 15
For the sake of posterity, I was able to get this working by setting the
ranges like this:

192.168.0.0/255.255.255.0

Which seems to me as if it includes the router's address (see previous
posting). I don't understand this, but it works.

The only thing left to make it better is to be able to refer to each
machine by name. The terminology here is very confusing to me. Both
computers have the same *domain* name, a string ending like *.org, and
also a unique name identifying the box, a single word. So how should the
machines be referred to by name?

Thanks everybody,
 
  


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
Can't SSH in past router (D-Link DI-604) Chuk Linux - Networking 15 12-17-2007 12:42 AM
Need Help Setting Up My Web Server Using D-link 604 Router dus3d Linux - Networking 5 04-15-2006 07:30 AM
D-Link DI-604 or SMC 7004VBR? cnsdjn Linux - Networking 1 08-08-2005 08:21 PM
OT? Hacking the D-Link DI-604 4-port router - not wireless BlackCat3416 Programming 3 07-20-2005 07:54 PM
D-Link 604 router w/ DHCP chbin Linux - Networking 4 03-26-2005 11:37 PM

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

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