Static IP Address for Raspbian

From KlavoWiki
Revision as of 13:02, 18 October 2013 by David (talk | contribs) (Created page with "To create a static IP address for Raspbian. <pre> vi /etc/network/interfaces </pre> Change the line <pre> iface eth0 inet dhcp </pre> to <pre> iface eth0 inet static </pre> ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

To create a static IP address for Raspbian.

vi /etc/network/interfaces

Change the line

iface eth0 inet dhcp

to

iface eth0 inet static

and add the following lines

address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Here is an example of my config file.

auto lo

iface lo inet loopback
iface eth0 inet static

address 192.168.13.252
netmask 255.255.255.0
network 192.168.13.0
broadcast 192.168.13.255
gateway 192.168.13.254

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp