In the last tutorial we’ve copied all the necessary files to the sd card formatted in Part I. Now insert the card in the Raspberry Pi connected to a Monitor and you will be asked for the login credentials.

Welcome to Kasuga.
Kasuga login: pitos 
#


Configuring Internet connection

Plug the ethernet cable in the socket and configure the /etc/network/interfaces file. Let’s use vim to edit the file and to add the following lines. But first… let me take a seflie of the file!

# cp /etc/network/interfaces /etc/network/interfaces.bk
# vim /etc/network/interfaces
# Configure Loopback
auto lo
iface lo inet loopback

# Static ip address
auto eth0
iface eth0 inet static
    address 192.168.1.135
    netmask 255.255.255.0
    gateway 192.168.1.1

# Dynamic ip address, uncomment following line
# iface eth0 inet dhcp


To edit a file in vim, move the cursor to the desired location and enter the editing mode by pressing a. Write what you need and press ESC. To save and close, press :wq. To close without saving, press :q or :q!.


Save and exit. Now check you internet configuration with ifconfig command and bring the eth0 network interface up with ifup eth0.

# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
# sudo ifup eth0
[ 1732.876089 smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 # ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX inet addr:192.168.1.135 Bcast 0.0.0.0 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:195 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9534 (9.3 KiB) TX bytes:0 (0.0 B)

As you can see, we are now connected to the network. Try to ping your gateway with:

#  ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.34 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.661 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.24 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.661/1.085/1.347/0.303 ms
#

Ok now try to ping google.com and you will get a bad address error. In order to solve this problem we need to set up DNS informations in the /etc/resolv.conf file.

#  vim /etc/resolv.conf
nameserver 192.168.1.1 (your gateway_ip_address)
nameserver 8.8.8.8
nameserver 8.8.4.4

press :wq to save and exit 
# ping google.com
PING google.com (173.194.35.39): 56 data bytes
64 bytes from 173.194.35.39: seq=0 ttl=55 time=25.238 ms
64 bytes from 173.194.35.39: seq=1 ttl=55 time=26.169 ms
64 bytes from 173.194.35.39: seq=2 ttl=55 time=27.252 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 25.238/26.219/27.252 ms

Connect remotely to your Raspberry Pi

Now that we’ve set up the network interface you can connect to the Raspberry Pi remotely using ssh. Try from another computer to run the command:

ssh root@192.168.1.135
root@192.168.1.135's password: pitos
#

You should be able to connect from computer in the same Lan network.

Installing external packages

We can not install packages as we are used to in ubuntu with apt-get install command. We have specified in the system configuration gui in the last tutorial, two package managers ipkg and opkg. [TO BE CONTINUED]