Linux Linpus home network - made easy

Status
Not open for further replies.
Joined
Jul 24, 2008
Messages
42
Reaction score
0
What is a netbook without networking? So that is why I think there should be a guide to setup the most common network stuff.

(This will be a guide that is supposed to grow as I get things working on my machine ...)
Index:
1. Hostname
2. NFS client
3. Samba
4. Printing

1. Hostname
[EDIT : just got solved with a little help from shihan]
You'll have to set your hostname in "/etc/sysconfig/network", you can't edit "/etc/hosts" because that gets overwritten on every reboot.
Also you have to command out the line : "HOSTNAME='/bin/hostname'
Code:
#mousepad /etc/sysconfig/network
HOSTNAME=[your hostname without domain name!!]
Reboot and that should do the job....

2. NFS client

(To setup the server, please follow a guide specific for your distro or OS)

Install the following from the package manager:
rpcbind - 0.1.4
nfs-utils - 1:1.1.1

Create this directory:
Code:
#mkdir /var/lock/subsys
Execute these commands:
Code:
# service rpcbind start      (this rpcbind seems to be the replacement for portmap)
  # service nfslock start 
  # service netfs start
  # chkconfig rpcbind on
  # chkconfig nfslock on
  # chkconfig netfs on
To check that the appropriate services are running you can execute rpcinfo:
Code:
# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100000    4     0    111  portmapper
    100000    3     0    111  portmapper
    100000    2     0    111  portmapper
    100024    1   udp  32792  status
    100024    1   tcp  44507  status
    100021    1   tcp  50882  nlockmgr
    100021    3   tcp  50882  nlockmgr
Now with the following you can check which shares are available on your server:
Code:
#showmount -e [server ip/name]
Mount the drive wherever you want with the following command:
Code:
#mount -o nfsvers=2 [server ip/name]:/home Network/home
(I had to add the 'nfsvers' option because my nfs server is version 2 and linpus defaults to version 3, but this depends entirely on your distro and setup)

To have that mount automated, you'll have to edit /etc/fstab, my entry looks like:
Code:
[server]:/home        /home/user/Network/home nfs     auto,nfsvers=22ro,user  0 0

4. Samba (clientside)
I don't think such a guide could do without the setup instructions for this app ... but I don't have any direct use for this, so it would be super if someone would feel the need to fill this gap ;-)

5. Printing
A) to windows print server

B) to linux print server
(my next item I will try to get to work through cups)


Addendum:
Please feel free to add any useful information or correct me where I made mistakes. English is not my primary language, my excuses if there are some (to many) mistakes in the text...
 
Thanks for this little HowTo.

I still have the problem that my NFS connection will not be established automaticly when booting the system. I think the reason is that the nfslock service could not be started because there is no network device with an ip adress at this time (in my case it is an wlan connection which takes longer to be activated as the rest).

Is there a way to make the NFS connection dependent on a successfull established wlan connection ?
 
I'll fill in item 4, How to Connect to a Samba Share as a client --

No additional software is needed. Given you already know the name and shared drive on the server, you can jump right to mounting the share through fstab (from the terminal):

1. Create your mount point.
Code:
sudo mkdir /mnt/share

2. Edit the fstab:
Code:
sudo mousepad /etc/fstab

3. Add the share in fstab by going to the bottom of the file and adding on a new line:
Code:
//remoteserver/sharename /mnt/share cifs user=Username,pass=Password,uid=1000,iocharset=cp850,unicode 0 0
Save and exit.

4. Mount the drives.
Code:
sudo mount -a

Obviously change Username and Password based on your install. This is all plaintext, if you want security you'll need a credential file. Your iocharset may vary, cp850 seems to work well with my Buffalo Linkstation. Best of luck!
 
Thank you @ jrs !!! ;)

Concerning NFS:
I'll have to confirm that you have to start nfslock and netnfs manually (or script) after a reboot, because nfslock can not be initialized without ip address. I'm currently searching for a solution.
:roll:
 
I got the samba shares on my server mounting fine but they drop out after suspend/resume. Any suggestions?

Allan
 
Allan, I have a hunch you'll need to modify /etc/sysconfig/network-scripts/ifup to remount the volume. I'd look around or ask on a Fedora forum before digging in. Let us know when you get it working.
 
Status
Not open for further replies.
Back
Top