TeCoEd (Teaching Computing Education)
  • Home
    • Freelance
    • Book
    • Downloading
  • Python
    • Learn Python >
      • Python Modules
    • PyGame Zero
    • Python Programs >
      • Higher or Lower
      • Magic Calculator
      • Password Checker
      • Python Pit
    • What's News App
    • Pixels to Cells
    • Python Mosaics
    • Python OCR
    • L-1-AM
    • Web Scraping >
      • Scraping Trains
    • Weather App
    • Snakes and Windows
    • Python Web Server >
      • Flask
    • Python Picks
  • Ras Pi
    • All About the Pi
    • Getting Started
    • Remote Desktop and VNC
    • Static IP Address
    • Sonic Pi >
      • 3.14
    • Twitter Feed >
      • Tweepy
    • Android & Pi >
      • Advanced Apps
      • Odds
    • A.I on the the Pi
    • CRON
    • Pick Your Own
  • Pi Hardware
    • Pi HATS >
      • Sense Hat Hacks
      • AstroPi HAT
      • Unicorn-HAT >
        • Unicorn Alphabet Disco
        • Uni Codes / Programs
      • Skywriter
      • Piano HAT
    • STS Pi
    • Pi Camera >
      • Pi-Cam, Python & Email >
        • Time Lapse
      • Pi Noir
    • Pipsta >
      • Flask, Input & Printers
    • Raspberry Pi Power >
      • Energenie IR power
    • Pibrella
    • Distance Sensor
    • LCD Screen
    • Pi-Tooth
    • Robot Arm
    • PiGlow
    • PiFM
    • Accelerometer
    • PiFace >
      • Installing PiFace >
        • Python Commands
  • Pi-Hacks
    • Drone Hacks
    • Pi Glue Gun Hack
    • Blinkt!
    • Sonic Pixels
    • R2D2
    • Get to the chopper
    • Astro Bird
    • Twitter Translator
    • Hacking a Robot
    • Nature_Box >
      • Best Nature Photos
    • Wearable Tech >
      • Project New York
      • P.N.Y Part 2 Health
      • P.N.Y Part 3 Games
      • P.N.Y Part 4 Translation
    • Dino-Tweet
    • Other Links
  • Pi-Hacks 2
    • The Joker
    • Hologram Machine
    • Google Vision: Camera Tell
    • Yoda Tweets
    • Pi Phone
    • Darth Beats
    • Twitter Keyword Finder
    • Crimbo Lights Hack
    • Xmas Elf
    • Halloween 2016
    • Halloween Hack 2015
    • Socrative Zombie
    • Voice Translation
    • The Blue-Who Finder
    • GPIO, Twitter
    • Pi Chat Bot >
      • Dictionary Definitions
    • PiGlow & Email
    • Pibrella Alarm System
    • SMS with Python >
      • Spooking a Mobile
  • Pi-Hacks 3
    • LED Dance Suit
    • Ferminal
    • Crypto Tracker
    • David Bowie
    • Lamp Prank >
      • TEST
    • Yoda FM
    • Retro Player
    • LED Pixel Art
    • TARDIS
    • Battleships
    • LED Board
    • Night Vision
    • Enviro+ Weather
  • Minecraft
    • Minecraft API
    • Minecraft Sweeper
    • PiGlove: Minecraft Power Up
    • Minecraft Photo-booth
    • Rendering Pixels
    • Speed Cube
    • Lucky Dip
  • Computing
    • Why Computing?
    • Can You Compute
    • micro:bit
    • Coding Resources
    • Learn to Code >
      • Coding with iPads
      • Apps Creation Tools
      • sKratchInn
      • Sound Editing
    • Cheat Sheets
    • Theory
    • HOUR OF CODING
    • BEBRAS Computing Challange
    • Computer Facts
    • Free Software and Links
  • Contact Me
  • Random Hacks
    • Movile

Why do I Want a Static IP Address?


An IP Address (Internet Protocol) is a a set of numerical digits that identify a device and its location on a network.  It is similar to your house address except that it uses numbers.  If your Raspberry Pi is connected your Router then it will automatically be given its own IP address.  The issue is that this address will change each time you log on and off.   This is know as a Dynamic Address - it changes.  A Static IP Address remains the same all the time and makes it easier to access your Pi.

Getting Started


Basically you need to identify your current network settings and modify them so that the IP Address remains static.  Firstly check that your address is not already Static .

In the LX Terminal type:
cat /etc/network/interfaces   

This will load an overview of the connected network devices, you are looking for the third line which states: iface eth0 inet dhcp The DHCP means that your IP Address is Dynamic and will change when you turn the Pi off.
Picture

Collecting the Information: Part 1


The next part is to collect the information relating to the your current IP Address, the Broadcast address and the Netmask address, these are abbreviated to Inet, Bcast and Mask.  All the values are on the same line so it is easy to coppy them down in one go

In the LX Terminal type:
ifconfig 

Write these three values down as you will require them later
  • inet addr
  • Bcast
  • Mask
Picture

Collecting the Information: Part 2


The next part is to collect the Destination and the Gateway address.  There are two commands that you can use the access them.

In the LX Terminal type:
netstat - nr  or  route -n

Write these two values down as you will require them later
  • Destination
  • Gateway
Picture

Making the IP Address Static


The final part of the Static IP process is to open the original cat /etc/network/interfaces   file in edit mode.  

In the LX Terminal type:
sudo nano/etc/network/interfaces

Change the iface etho0 inet dchp to iface etho0 inet static 
Next enter the previous information you collected in parts 1 and 2 , in a list below the statement  iface etho0 inet static, 

address       
192.34..... etc     (inet address)
broadcast   194.34..... etc    (Bcast)
netmask     255.25..... etc    (Mask)
network     192.34..... etc    (Destination )
gateway      192.34..... etc   (Gateway)

Remember to replace the addresses with the ones from your network that you collected earlier.
Picture

And to Finish with....


If you are comfortable with IP addressing schemes you can also change the inet address, the first one, to one of your choice - or keep it the same as it is. To complete the process reboot your Raspberry Pi, 

In the LX Terminal type:
sudo reboot

You are all finished, you could ping the IP address to check the settings, 

In the LX Terminal type:
ping 192.156.23.5 c-10

The c-10 only sends 10 pings!


Powered by Create your own unique website with customizable templates.