Hardware Reference
In-Depth Information
Figure 5-1:
Editing /etc/
network/
interfaces
with nano
Make sure that you press the Tab key at the start of each line, and don't actually type
[Tab]
.
he
x
characters in the configuration lines represent network addresses you'll need to enter.
For
address
, you should enter the static IP address that you want to assign to the Pi. For
netmask
, you should enter the network mask—which controls the size of the connected
network—in what is known as
dotted-quad format
. If you're using a home network, this is
typically 255.255.255.0. For
gateway
, you should enter the IP address of your router or
cable modem.
As an example, the settings for a common home network would look like this:
iface eth0 inet static
[Tab]
address 192.168.0.10
[Tab]
netmask 255.255.255.0
[Tab]
gateway 192.168.0.254
When you've finished editing the file, press CTRL + O to save it, and then press CTRL + X to
leave
nano
and return to the terminal. To use your new network settings, restart the
net-
working service
by typing the following:
sudo /etc/init.d/networking restart