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.
I recently bought my first switch not knowing anything about how the thing works, what it does... well, almost nothing. I had already experimented with connecting two computers with a crossover cable (CAT5), changing to static IP addresses, etc. ... with some degree of success, however, on Windows only. I was pleasantly surprised with I plugged everything into the switch (3 computers and a router) and booted Windows on all three computers. Everything worked!! It was literally 'plug and play'!!
I'd never spent a lot of time trying to do similar things on Linux. The three computers also have Linux installed on them (FC6 GNOME and Mandriva 2007.0 KDE). I've spent a couple of hours Googling and experimenting more recently. I'm looking for a simple step-by-step tutorial on how to get everything working to share an Internet connection, files, printers, etc. I haven't had any luck so far. I found one decent site, however, they forgot to explain where exactly to go to do what it was you were supposed to do every step of the way (e.g., System -> Location A -> Location B...). Very frustrating!!
Here's precisely what I'm looking for:
FIRST OF ALL:
1. A very simple step-by-step tutorial or HowTo which explains how to share files between the computers connected to the switch on Linux, of course.
2. As above, but for sharing printers, Internet connections...
AND ALSO (and this doesn't necessarily have to have anything to do with the "FIRST OF ALL" part, not directly anyway...:
A. A good tutorial on LAN's in general. (I'd like to learn more about networking in general, something that might lead to more advanced skills, network administration, etc.)
B. For practice, I was thinking of setting an Intranet site, a LAN site, a sort of "home blog" that the members of the household could edit and which would be the homepage on all of the computers. This would encourage everybody in the household to learn computer skills (website editing, etc.). How might I set this up? Could I use Apache and learn how to use it in order to do this?
I've spent quite a bit of time searching the Net for Questions 1 & 2 and haven't been able to find a good tutorial. All I want is to be put on the right track, a few tutorials and HowTo's. For A & B, some advice for someone who has no idea where to start.
Many thanks if you've read to the end of this post!
1-For the first point probably you can search for "Samba"
2-About printers search again for Samba. To share the internet connection you can look for "iptables masquerade".
B-Yes you just need to install and configure Apache
You want a tutorial? This is the one that got me started: http://www.yolinux.com/TUTORIALS/Lin...etworking.html
It must be good because that was all it took for me to get my home LAN up and running, from zero prior knowledge.
In my experience, home LANs are easier to manage in the long term, with static IPs. YMMV.
For sharing printers over linux LANs (I have no idea how to do windows!) cups will manage all this for you. Just set up the printer on one machine, and edit the /etc/cups/cupsd.conf file on that machine (it's very well commented) to allow broadcasting of the printer server to, and connections from, your LAN's range of IP addresses. Restart the cups daemon and you are off. You'll have to fire up cups on the other machines, add a printer, it's a networked printer, cups can search for it, tell cups it's a "Raw" printer (because the "driver" is handled by the printer server), and you are done.
For sharing internet connections: I just plug the ethernet cable from my DSL modem into the switch, the other PCs into the switch and point them at the LAN address of the modem (usually something like 192.168.0.1, or 10.0.0.1, it depends on your model, and whether you have changed the defaults). This should work for both windows and linux machines.
Then you can play with passwordless ssh, remote desktops, the fish://remotehost/home/ protocol in konqueror and a lot more besides.
For sharing internet connections: I just plug the ethernet cable from my DSL modem into the switch, the other PCs into the switch and point them at the LAN address of the modem (usually something like 192.168.0.1, or 10.0.0.1, it depends on your model, and whether you have changed the defaults). This should work for both windows and linux machines.
Only if your Internet Provider allows multiple machines to connect, which most don't.
Grab a router, plug that to the modem, and hang all your machines off the router.
Thanks to all for your comments and suggestions. And a big thanks to teckk for the links. I guess that will save me a trip or two to the library and bookstores... and a few quid too! It's exactly what I was looking for. I'm sure it will keep me busy for the next few weeks. Excellent!!
Just one thing though, is there a quick, easy, step-by-step way of getting the computers communicating with each other? In 5 or 10 steps? Or perhaps it's a bit more complicated in Linux.
Thanks!
Last edited by rm_-rf_windows; 07-08-2007 at 02:58 AM.
is there a quick, easy, step-by-step way of getting the computers communicating with each other?
Yes. See the links teckk and I gave you in the above posts. It's easy!
The best thing to do is stop worrying about it all, and just jump in and get started. Then if you encounter things you do not understand, or will not work for you, come back here and ask for clarification.
Basically:
1] Decide on your local network IP addressing - eg 192.168.0.x (See the links)
2] Assign IP addresses to your PCs (See the links)
3] Assign names to your PCs, and list these, with IP addresses in each PCs /etc/hosts file (See the links)
4] Connect them up to the switch.
5] See if they can ping each other (See the links)
6] If they can, you are networked (See the links)
I've done some reading and have even started using qwordquiz to learn all of the acronyms and a lot of other information about networks. Lots of things to learn, the sites listed are dense, but very interesting. Really excellent, thanks so much. I'm going to have to read, reread and study.
I've also done a little experimenting. My setup is a little difficult to describe, so please read the following carefully.
I've got 3 computers: 2 laptops and a desktop.
COMPUTER 1: DESKTOP with 4 OSs:
- Windows
- Mandriva (KDE)
- Debian (GNOME)
- Slackware (KDE)
COMPUTER 2: ASUS LAPTOP with 2 OSs:
- Windows
- Fedora (GNOME)
COMPUTER 3: FUJITSU LAPTOP with 1 OS:
- Windows
Everything's hooked up via a D-Link Switch (ADSL router).
I can do everything with Windows (share files, printers, Internet connection works), but I cannot ping from Windows to Windows.
The only Linux to Linux file sharing that I've been able to do is from Fedora to Debian (one-way); that is, my Debian OS could retrieve Fedora files, no problem. Not possible the other way round (to retrieve Debian files from Fedora). Not possible to do any other Linux to Linux file sharing. Note that I'm using GNOME on both Fedora and Debian. I was able to access my Fedora files by doing: Places -> Network Servers -> "SFTP File Transfer on localhost" -> etc.
Pinging:
- impossible to ping from Windows to Windows, however, everything works!
- impossible to ping from Fedora to Mandriva (on Fedora), but I can ping from Mandriva to Fedora (on Mandriva)
- Fedora <=> Debian (pinging works both ways)
- Fedora <=> Slackware (pinging works both ways)
- I can ping Debian and Slackware from Windows (on Windows/DOS), but it never works the other way around.
However, I repeat, I can only share files one-way, that is, access Fedora files from Debian... No other combination works. I do get an Internet connection on all OSs though, and the IP addresses are okay.
So I suppose I need to do some reading on firewalls and maybe some reading on ports as well while I'm at it, why not?
I don't know if I've given enough information for any further suggestions, but perhaps there are problems common to all Mandriva installations, for example, and perhaps to other distros as well and that the symptoms I've described might sound familiar to some of you out there.
Is it important to change the "localhost" name? How about domain names, etc... I think the Debian OS is the only one that doesn't have "localhost" as localhost name. I know that on Windows the workgroups must be the same on all computers. In any case, I wouldn't mind learning more about all of these sorts of things (if anyone has a link or two they could recommend).
I'm glad everything isn't working in a sense... an opportunity to explore and to learn.
Thanks so much once again to everybody for the excellent information given above.
P.S. - I forgot to mention that I cannot access any Windows files or anything else from any of the Linux distros
Yes, there are a lot of things to learn, but that's part of the point, and it's fun too. Especially when you can get things to work exactly as you like.
I am not going to hold your hand, but I will give you some pointers I wish I had had when I started:
Life, The Universe and Everything is made much simpler if your login name and UID is the same on all your linux PCs. Mandriva used to like to number UIDs from 500, most other distros start at 1000, so your usernames may not match up on different distros even if they are named the same. You have been warned.
Mandrake used to install and start a firewall the moment you installed ssh. This caused me grief, because my network suddenly stopped working (see a cry for help from me a few yrs ago, here on LQ).
I trust my LAN, so I put my firewall in my all-in-one DSL Modem/router/switch (Currently a Netgear GD834G, but most models seem to offer this functionality now anyway). That way I don't need to firewall individual machines. Because I trust them, with good reason: I set them up.
So the cabling config is like this :
Code:
|----PC1
|
Internet--[DSL Modem]-[Firewall]-[Router]-[Switch]-|----PC2
|
|----PC3
|
|--[Encrypted WEP Wireless] .........PC4
^ ^
|------My DG834G does all this----|
^ ^
|--This is my LAN, which I trust--|
Quote:
Is it important to change the "localhost" name?
No, do not do this. You need a localhost name for the "loopback" interface at 127.0.0.1
You also need another name for your computer(s). See /etc/hostname and man hostname
My /etc/hosts files look something like this (names have been changed to protect the innocent!)
Code:
# The next uncommented line is vital. Your computer will not work without it!
# Putting NameOfThisComputer as an alias for "localhost" keeps things tidy
# but is not strictly necessary
127.0.0.1 localhost NameOfThisComputer
192.168.0.8 NameOfThisComputer.home.net NameOfThisComputer
192.168.0.6 pc3.home.net pc3
192.168.0.4 pc4.home.net pc4
192.168.0.20 hp.home.net hp
192.168.0.21 bx.home.net bx
192.168.0.30 gg.home.net gg
home.net is just rubbish, you can put pretty much anything here because it is local to your LAN, but just be consistent. It works for me because when I visit family elsewhere (who now also run linux, and haven't noticed the difference), my laptop can connect to their ISPs, because I have set up their networks like mine (same IP address space (192.168.0.X) same home.net). That's nice, and they don't care so long as it works, which it does.
Quote:
P.S. - I forgot to mention that I cannot access any Windows files or anything else from any of the Linux distros
I haven't felt the need to use windows for a few years now, and I am not going back(TM). But to connect linux to windows, you'll need samba. Read up on it. Install it. Configure it and use it. Other people use it happily, so it can't be that difficult.
My advice: Continue to read and experiment.
Setting up linux networking was actually easier than windows (for me anyway).
So, set up the linux computers first. I note that your desktop has 3 distros available - get real, and choose one distro to be network-friendly, then do the rest when you have time. Warning: Debian and Mandrake do things differently when it comes to configuration files.
Windows does pointy click, pointy click, pointy click-click - "There it's working!!".
But then you have the Trojans, keyloggers, spam-mailers and spawn from Hell as well. And you have no idea why, or how, this happened.
Once you have set up your linux network, you'll understand it, so then you can gently introduce your windows machines, if you must.
This way, you'll understand how your network works, and hopefully be secure.
Quote:
I'm glad everything isn't working in a sense... an opportunity to explore and to learn.
You are correct. Some work is involved, but maybe it'll save you from Alzheimer's. Break your problems down into easily digestible pieces, one step at a time please. There is no magic "sort it all out for me NOW, so I can use it NOW" so-called "wizard".
Experiment and have have fun. You'll learn a lot, and eventually get that warm glow of satisfaction when it both works, and you understand just why it's working.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.