Open up a terminal, type:
$ sudo nano /etc/network/interfaces
change the part under "auto eth0" (ethernet connection) to
auto eth0 iface eth0 inet static address 192.168.0.2 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 192.168.0.1
Restart the network
$ sudo /etc/init.d/networking restart
Install the ssh server to allow remote login:
$ sudo apt-get install openssh-server
To log in; in a remote linux computer, type
$ ssh acm@192.168.0.2
We will want internet connection, so that we can exchange code with the SVN server.
Set up the IP in the file /etc/network/interfaces following the instructions in the last session.
Then edit the file /etc/hosts. This is where the mapping of hostnames to IP addresses, i.e. where you can speicify a hostname/alias for a particular IP address.
The /etc/hosts on my workstation looks like:
$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 acm-desktop desktop 192.168.0.191 acm-laptop laptop 192.168.0.2 acm-robucar robucar 192.168.0.199 ACMoldlaptop
The format is <IP> <HOSTNAME> <DOMAIN> <ALIAS>
Once it's all set up, to log in the robucar, we can just type:
$ ssh acm@robucar
Change the hostname/alias to whatever you are more comfortable to remember.
Remember to also add the alias on the robucar.
The /etc/hosts on our robucar looks like:
$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 acm-robucar robucar 192.168.0.190 acm-desktop desktop 192.168.0.191 acm-laptop laptop 192.168.0.2 acm-robucar robucar
Set the IP on the workstation.
There are two ways to do set a static IP: set a static IP as we did for robucar, or use DHCP Reservation(also called "Static Allocation").
Here we use the second approach. This can be easily set up on the configuration page of the router.
The /etc/network/interfaces file looks like:
# the primary network interface, use static-dhcp auto eth0 iface eth0 inet dhcp