I have been trying to set a static IP using the Ethernet until John pointed out that I should buy a router to get a private network. In fact, ain’t I already using a router with my WiFi dongle? Hahaha! Oh my how silly am I. :p Thanks John!
So instead of configuring a static IP for eth0, I should instead do it for wlan as such:
sudo nano /etc/network/interfaces
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet static
address 192.168.1.109 #static IP that I chose
To get the IP address range, type
ifconfig, to get gateway address, type
To choose a static IP that is free and not in use, i use my laptop cmd to ping to the address. For example, I knew that my dhcp IP address was 192.168.1.108, so i ping that from my laptop and there is reply indicating that it is in use. Then I chose another number, 109, and ping it. When it replies “Destination host unreachable”, I know it is not in use.
Next up, save the RaspberryPi config for PuTTY and FTP! 🙂 Then I shall set up the LAMP web server.