Find the answer to your Linux question:
Results 1 to 10 of 10
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    need help with basics of a simple home network

    Hey everyone,

    I am very new to linux, and networking, but not computers in general.

    I ultimately (as of now) want to create a file/print sharing network between 2 computers each running only Ubuntu 8.04. Could anyone provide a link to some basic documentation on both the physical and software setup on how to do this?

    To give you some information on how things are currently setup (NOT using wireless):

    Computer 1 (which I want to be the "main computer or server, I guess)
    Computer 2 (client computer)

    I have a cable line for internet coming from the wall, it enters the cable modem, which has CAT6 running to my NETGEAR wireless router. The router I suppose is acting as a switch with 1 CAT6 cable running to each of computers 1 and 2. Computer 1 is using eth 1 to connect to the internet (which is working) and Computer 2 is using eth 0 to connect to the internet (which is also working). How can I make each computer "see" and recognize the other's existence so that I can set up my file sharing network between the two?

    Thank you so much,


  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    the hills
    Your router has already done most of the work for you.
    Open a command terminal on one of the computers, and
    type the command /sbin/ifconfig

    This will give you some network configuration information.

    rcgreen@blue:~$ /sbin/ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0E:A6:94:D0:B5  
              inet addr:  Bcast:  Mask:
              inet6 addr: fe80::20e:a6ff:fe94:d0b5/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:623838 errors:13 dropped:0 overruns:0 frame:25
              TX packets:383363 errors:1 dropped:0 overruns:1 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:870013161 (829.7 MB)  TX bytes:37574535 (35.8 MB)
              Interrupt:17 Base address:0xc000 
    lo        Link encap:Local Loopback  
              inet addr:  Mask:
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:3465 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3465 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:616359 (601.9 KB)  TX bytes:616359 (601.9 KB)
    It will tell you the IP address. Go to the other computer
    and ping that address.

    rcgreen@lisa:~$ ping
    PING ( 56(84) bytes of data.
    64 bytes from icmp_seq=1 ttl=64 time=5.79 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.555 ms
    64 bytes from icmp_seq=3 ttl=64 time=0.641 ms
    64 bytes from icmp_seq=4 ttl=64 time=0.633 ms
    --- ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 2999ms
    rtt min/avg/max/mdev = 0.555/1.907/5.799/2.247 ms
    If you can ping back and forth successfully, you can add
    a name to each computer's /etc/hosts file to give
    them friendly names. You gave each machine a host name
    when you installed the OS. Use these names.

    rcgreen@blue:~$ cat /etc/hosts       localhost       blue    router    stacy    ocean   kirby   blue    blue.localdomain   lisa   shelly   merlin
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    After this, if you have no Microsoft computers, you can
    choose an easy file sharing protocol like nfs

    nfs(5): nfs/nfs4 fstab format/options - Linux man page

  3. #3
    Thanks for all your help. I'm starting to make sense of everything. I don't know the code to put up the output windows, so I'll tell you what I get.

    I am able to successfully ping each of the two computers on the network with output similar to yours. My IPs are and After that I ran the "cat /etc/hosts" code, and that is where things were somewhat different. The IPv6 section is irrelevant at this point I think, but it was the same (roughly) as your posted o/p. However, the beginning of the file only lists as follows:
    1st PC: localhost UTAEngineer
    command line says controls@UTAEngineer

    2nd PC: localhost Engineer
    command line says mokrunka@Engineer

    It seems that your hosts file lists the "lisa" and "blue" computers and IPs where mine should say "Engineer" and "UTAEngineer" with their IPs.

    Do I need to add the names and IP addresses to this file in order for them to recognize each other on the network? It seems strange that I am able to successfully ping each machine from the other, when they are not listed in the hosts file.

    Thank you very much, this has been a most useful post.


  4. $spacer_open
  5. #4
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    the hills
    Yes, you need to edit the host files yourself. You need root
    (or sudo) authority to edit the files. Just add the appropriate
    names and addresses.

    The command line terminal is in the Applications-->accessories
    menu. From there sudo gedit should be the command to
    open your text editor with the authority to edit system files.

  6. #5
    Thank you so much for your help rcgreen. This has helped me develop a feel for the commands and terminal window as well as some very basic networking info.

    My next question is: Now that I have successfully edited the hosts files on both machines, what can I do now? What exactly have I done by doing this? And how can I share files between the machines?



  7. #6
    Hello again RCgreen. I seem to have set everything up including the hosts files, and the exports file, and made sure all the daemons were running.

    I am able to mount a remote FS one way but not the other (eg from PC1 onto PC2 but not the inverse). When I try it the other way, I get an error: you do not have permission to access the server. I tried as root, and I believe that I did everything the same on both PCs, so I'm stumped why I can't remote mount on each one.


  8. #7
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    the hills
    OK, what does /etc/exports say on the one that is successfully exporting its files? There must be some small difference between
    the things on the two computers.

  9. #8
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    South Africa

    I learned a great deal from this thread as well and I really do not want to sabotage this topic. Rcgreen, do you perhaps know what I can do to share a ppp connection to two other pc's using and not using Linux. I am using Ubuntu 8.04.

    I have a router from our old DSL conn but currently we are on a new connection with a USB modem.


  10. #9
    /home Engineer(rw,no_subtree_check,no_root_squash)-- This is the computer where it works.

    /home UTAEngineer(rw,no_subtree_check,no_root_squash)

    There are other things in the file but they are all commented out, these are the only lines of code in each file.

    Very strange, I did however get brave and start playing with some other stuff one the one that is working. I can now SSH into my other PC, and use SCP in order to copy files from one to the other! Thanks for all your great advice!


  11. #10
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    the hills
    About connection sharing

    Ubuntu Server Guide - IP Masquerading

    I can't see why one works and the other doesn't. Are you sure the daemon is running? the ps aux command should list the running

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts