Skip to content

Instantly share code, notes, and snippets.

@marc-hanheide
Last active August 29, 2015 14:23
Show Gist options
  • Save marc-hanheide/ad621dd978c0a8b7bc43 to your computer and use it in GitHub Desktop.
Save marc-hanheide/ad621dd978c0a8b7bc43 to your computer and use it in GitHub Desktop.
NFS and network setup on robots

NFS setup:

Main PC:

  • sudo mkdir -p /export/users

  • mkdir /nfshome

  • sudo apt-get install nfs-kernel-server

  • /etc/exports:

/export 192.168.0.0/24(rw,fsid=0,insecure,no_root_squash,no_subtree_check,async) /export/users 192.168.0.0/24(rw,nohide,insecure,no_root_squash,no_subtree_check,async) ````

  • /etc/fstab:

/nfshome /export/users none bind 0 0 ```

  • sudo mount -a
  • sudo service nfs-kernel-server start

Side-PCs

  • sudo apt-get install nfs-common

  • mkdir /nfshome

  • /etc/fstab:

192.168.0.100:/users /nfshome nfs auto 0 0 ```

  • sudo mount -a

Make specific user (here: lamor) use it

  • make sure user's UID and GID is the same an all machines
  • move the user's files sudo mv /home/lamor /nfshome
  • change the user's home dir (ON ALL MACHINES): sudo vim /etc/passwd: lamor:x:2000:2000:,,,:/nfshome/lamor:/bin/bash

Network setup (main PC as router)

  1. create a file iptables.in:

Generated by iptables-save v1.4.21 on Thu Jun 25 17:36:16 2015

*nat :PREROUTING ACCEPT :INPUT ACCEPT :OUTPUT ACCEPT :POSTROUTING ACCEPT -A POSTROUTING -o wlan1 -j MASQUERADE COMMIT ``` 2. load with sudo iptables-restore < iptables.in 3. enable IP forwarding on the fly: `sysctl -w net.ipv4.ip_forward=1` 4. make it persistent: edit `/etc/sysctl.conf` and make sure the line `net.ipv4.ip_forward = 1` is in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment