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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
By echo77 at 2004-11-15 07:03
How to Network 2 Computers on LAN with a Crossover Cable.
A Newbie's Guide to Small Home LAN.
REASON FOR WRITING THIS TUTORIAL:
There may be a lot of people turned off by Linux because most of the tutorials available as of now, are significantly technical in nature, and you need to read a lot of jargon before you get to the point of 'what exactly is to be done to get it working'. And the 'what exactly to be done...' tends to rely on the jargon that you just skipped because it went over your head. A lot of users who would like to switch over from other operating systems to Linux would like
simple steps on how to connect to the internet, set up printers, set up a LAN, connect and use various peripherals. This tutorial is intended to provide simple steps, that are supposedly easy to follow. I will also mention some terms that you really need to know with their "newbie definitions" ;-)
This is intended for the Linux Newbie, or regular Linux users who are not into networking or system administration. This is a networking newbie telling others how he went about networking his 2 computers on a LAN using a crossover cable, setting up NFS shares, Samba shares, sharing the printer and sharing the internet connection. This is NOT meant for experts, and a lot of technical jargon is kept away.
DISTRO USED: Fedora Core 2. I will mention that I have used GUI components, and not commands. So those trying this tutorial on other Linux flavours should look out for differences.
GUI: Gnome Desktop v2.6
Part 1 has been tested by others and have had a good feedback when I posted it to my circle of friends and acquaintances. Please provide a feedback for the next parts. I will continue the newbie series as I get the time to do so.
I have 2 computers. I've called them TOM and JERRY. TOM has Fedora Core 2. JERRY is a dual boot with Fedora Core 2 and Windows XP. I connect to the internet using TOM. I have the printer on JERRY. I want to set up a small home network, so that I can surf the web/send mail with both computers sharing one internet connection, and also share the printer. I would also like to access files on each comp, from both operating systems.
I have LAN (Ethernet) cards installed on both. I can connect the two together without buying a hub. This can be done with a crossover cable. A crossover cable has some wires interchanged so that input of one comp is the output of the other and vice versa. (I do not know the restrictions on cable length) In my case, both comps are in the same room, and I have a cable 5m long.
You need to know the root password for both machines. I will skip the step where you will need to enter the root password. Please do so.
PART 1: Setting up the Network
Connect the crossover cable into the slots on the LAN card. When both computers are on, you will see the led on the ethernet card light up. This means that the connection is recognized by the hardware. Now you need the software to recognize it (without which you cannot use the connection). I assume you have booted up in Linux.
On TOM: Click on 'Hardware Browser' in 'System Tools'. The hardware browser will start and you will get a listing of hardware in your computer. Click on 'Network Devices' on the left. You will be shown the detected LAN Card and device information. Keep this window open so that you can recheck the card name & number, manufacturer, driver file and device. This is just in case, as mostly the card will be autodetected.
Next, go to 'System Settings' >> 'Network'. You will get a network configuration dialog. Click on the Hardware tab. You should see your device here. If no, click on new. Select Ethernet. Select the adapter that has the same number as the number of the card in the hardware browser. (If there are multiple numbers, you can select any one). Select device eth0. Keep IRQ to unknown and click OK. Your hardware is set.
Click on the devices tab. Click on New. Select Ethernet Connection and click Forward. Click on your Ethernet card name and click forward. Click on statically set IP addresses. There are only certain addresses that are legal to be used on the local network. Using any other address will screw up your internet connection as well. You can use 192.168.XXX.XXX with a subnet mask of 255.255.255.0. For example, I have used 192.168.10.1 for TOM and 192.168.10.2 for JERRY. Click forward and click on apply. Your device is now shown, and will be inactive.
Go to DNS tab. Enter a hostname of your choice (eg: tom.myhome.org). In the Primary DNS (and secondary DNS) enter the primary (and secondary) DNS addresses of your Internet Service Provider (ISP). If you do not know what they are, open a terminal window and type:
In this there will be something like:
These numbers are your primary and secondary DNS addresses. Enter them in corresponding fields on the DNS tab.
If you cannot find resolv.conf or it is empty, then skip the above step. It means that the internet connection is not set up properly. We shall handle this later.
Come back to the devices tab, select the device and click activate.
Repeat the above for JERRY. Remember to give it a different IP address and hostname. (eg: jerry.myhome.org, 192.168.10.2)
Open a terminal and type:
ping 192.168.10.1 (or tom's address/hostname)
ping 192.168.10.2 (or jerry's address/hostname)
Do this for both machines. You will get a response, which means your network is working! If not, please post the procedure that you followed in the forums and ask for a networking guru to help you.
Now we have to set up NFS shares, SAMBA shares, share the printer, and share the
PART 2: Sharing files Linux-to-Linux using NFS (Network File System)
NFS Shares: Sharing your files among Linux comps.
Tom & Jerry: both running Linux
This is just a basic configuration of the NFS. Please read the NFS Help document in case
you wish to customise your shares.
You are on Tom. In the menu, click on System Settings > Server Settings > NFS
In the NFS Server Configuration driver that comes up, click on 'Add'. In the directory, enter the directory you wish to share, or click on Browse and select the directory you wish to share. In Hosts, you will want to enter the hosts to which you want to share your directory. You can specify jerry.myhome.org or even *.myhome.org. Use the radio buttons to set the share as read-only (recommended) or read/write. You do not need to change any other options in the other tabs, so click on OK. Go through the NFS Help files (obtained by clicking on the Help button) if you want more details of configuration of NFS, or if you want
to configure it more. Assume that the '/home/username/shared' directory is shared. You
will have to start the NFS Server. Go to the menu System Settings > Server Settings >
Services, and search for nfs. Click it and click on the start button and wait for confirmation.
You may check the nfs checkbox to start the NFS Server at startup.
Once you have set up this directory, move to Jerry. Open a terminal window on Jerry. Get into superuser mode and change directory to /mnt. Create a directory that will map to the shared directory of Tom. Suppose you call that directory as tom_share, then type the following command:
mount tom.myhome.org:/home/username/shared ./tom_share
The shared directory from Tom will now be available in the /mnt/tom_share directory on Jerry. You will have your permissions as you have set them.
PART 3: Sharing files Linux-to-Windows using the Samba Server
Samba Shares: Setting up Samba: Sharing a Linux directory to be accessed from Windows.
Tom: running Linux, Jerry: running Windows, and has networking services turned ON.
You are on Tom. In the menu, click on System Settings > Server Settings > Samba
In the Samba Server Configuration driver that comes up, click on 'Add'. In the directory,
In directory, enter the directory you wish to share or click on browse and select the directory you wish to share. You may leave the description blank, or enter an appropriate description.
Provide the permissions. In the next tab "Access", you can either allow access to specific users or to all users. Since it is a small home network, you may set it to all to avoid access denials. Read help (obtained by clicking on the Help button) for more details.
Go to the menu System Settings > Server Settings > Services, and search for smb. Click it and click on the start button and wait for confirmation. You may check the smb checkbox to start the Samba Server at startup.
Once you have set up this directory, move to Jerry (windows). Refresh the network places. The shared Samba directory will now be seen from windows and you will be able to browse it in the windows explorer.