Skip to content

Network Configuration

Adam-Koch edited this page Jan 9, 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 my example will work as-is 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.

    auto lo        
    iface lo inet loopback
    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

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

Clone this wiki locally