Skip to content

Network Configuration

Adam-Koch edited this page Jan 8, 2013 · 3 revisions

It is recommended that your network settings be configured by MAC address on your DHCP server, but if you would prefer to configure the operating system with a static IP, you can do so as follows.

[pi@raspberrypi ~]$ sudo su [root@raspberrypi ~]$ mv /etc/network/interfaces /etc/network/interfaces.orig [root@raspberrypi ~]$ vi /etc/network/interfaces NOTE If you aren't familiar with vi, you just press the "i" button to go into --INSERT-- mode, then paste or type in the following. Obviously, the following values are specific to you (address/netmask/gateway/broadcast), however this will work provided you don't have another device with the IP of 192.168.1.200. When done, hit the following keys - Esc : wq! Enter to save the file.

#Loopback Interface auto lo
iface lo inet loopback

#Static IP Configuration auto eth0 iface eth0 inet static address 192.168.1.200 netmask 255.255.255.0 gateway 192.168.1.1 broadcast 192.168.1.255

Once complete, you can verify the file by using the following command.

[root@raspberrypi ~]$ cat /etc/network/interfaces

Now restart the network service.

[root@raspberrypi ~]$ /etc/init.d/networking restart

Verify the IP address is properly set.

[root@raspberrypi ~]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:18:8B:4B:9A:20 inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::218:8bff:fe4b:9a20/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:378698 errors:0 dropped:0 overruns:0 frame:0 TX packets:16660 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:18593424 (17.7 MiB) TX bytes:14654645 (13.9 MiB) 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:16436 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:624 (624.0 b) TX bytes:624 (624.0 b)

You should now be able to console into your RPi via SSH from another device on the network.

Clone this wiki locally