Linux - NetworkingThis 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.
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.
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.
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.
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.
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.
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?
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...
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.
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.
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:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.