Configuring a Static IP Address (Ethernet)

By default, OpenRepeater is setup to use DHCP to configure its ethernet network interface (eth0). If you want to change this so the ethernet port has a static IP address, here's how. DHCP for eth0 is enabled in the file /etc/network/interfaces. Here is what it looks like by default:
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
Out of the gate, we keep this simple so you can plug it into your network and get a DHCP assigned address and then just be able to use a discovery tool to find it and connect to it. Long term and for consistency, you will want to assign it a static IP address. You can modify the file to look something like this:
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.1.73
netmask 255.255.255.0
gateway 192.168.1.1
So, instead of the line:
iface eth0 inet dhcp
You'll need to replace that with lines like this:
iface eth0 inet static
address 192.168.1.73
netmask 255.255.255.0
gateway 192.168.1.1
The above example assigns the address 192.168.1.73 to eth0 with a subnet mask of 255.255.255.0 and a gateway of 192.168.1.1. You will need to make sure these match your network setup and double check your typing before you save the changes. Also, if you are running a mixed network (DHCP & Static), you will need to make sure you assign a static address that is 1) available on your network, and 2) is outside of where DHCP assigns addresses. You can use the following from the command line to edit the file:
nano /etc/network/interfaces
You will also need to check to make sure that you have a valid DNS server listed in /etc/resolv.conf. Edit this file using nano and add your DNS server (if it is not already there). If you are using a broadband router, add the address of your router as the DNS server. When done with editing these file, double check your entries, then save. To do this simply exit the file (Ctrl + X) then you will pre prompted if you want to save and overwrite the file. When done, restart the board:
shutdown -r now
Note: that if you were connected via SSH, you connection will be broken and you will need to reconnect with the new IP address you just set.
in Networking