LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-07-2007, 04:52 AM   #1
rm_-rf_windows
Member
 
Registered: Jun 2007
Location: Europe
Distribution: Ubuntu
Posts: 292

Rep: Reputation: 27
Configuring a Linux LAN with Switch


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!
 
Old 07-07-2007, 05:29 AM   #2
fatzeus
Member
 
Registered: Nov 2004
Location: Venice, Italy
Distribution: Gentoo
Posts: 44

Rep: Reputation: 15
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
 
Old 07-07-2007, 06:08 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please be aware that a LAN is NOT about sharing printers and other windows centric crap like that. if you can ping machines by IP then that's a LAN.
 
Old 07-07-2007, 07:08 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.

Have fun.
 
Old 07-07-2007, 04:02 PM   #5
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
Quote:
Originally Posted by tredegar
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.

Cheers.
 
Old 07-07-2007, 04:24 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
no, i think they just got the terms "modem" and "NAT router with integrated ADSL modem" confused...
 
Old 07-08-2007, 02:56 AM   #8
rm_-rf_windows
Member
 
Registered: Jun 2007
Location: Europe
Distribution: Ubuntu
Posts: 292

Original Poster
Rep: Reputation: 27
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.
 
Old 07-08-2007, 04:39 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
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)
 
Old 07-10-2007, 10:34 AM   #10
rm_-rf_windows
Member
 
Registered: Jun 2007
Location: Europe
Distribution: Ubuntu
Posts: 292

Original Poster
Rep: Reputation: 27
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
 
Old 07-10-2007, 05:22 PM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
OK, you have made start, that's good.

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.
 
  


Reply



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
Configuring router and switch Millenniumman Linux - Networking 3 07-07-2007 10:25 AM
Configuring Win98SE for a Linux LAN tireseas Linux - Networking 4 08-28-2005 09:36 AM
Need pointers for LAN, ADSL->Switch->2 coputers Ork Linux - Networking 1 03-07-2005 04:14 PM
LAN ftp via ZyXEL-switch starts but halts quickly psletten Linux - Networking 11 01-21-2004 10:03 AM
Configuring wireless lan on linux Belize Linux - Wireless Networking 2 12-22-2003 12:51 PM

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

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