Page 1 of 1

can't set static address

Posted: Wed Nov 04, 2015 4:36 pm
by petercli
Hello,
I am trying to switch my ip to from 192.168.1.169 dchp to 192.168.1.9 static

I am using raspbian debian wheezey on raspberry pi 2.
I am trying to follow a article in maximum pc octobler 2015 that shows steps to configure the machine. :
- sudo nano /etc/network/interfaces
- adjusted the numbers per my network (see below)

But the pi still shows 192.168.1.169. Any suggestions?
Thanks,PEter



allow-hotplug eth0
iface eth0 inet static
address 192.168.1.9
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Re: can't set static address

Posted: Wed Nov 04, 2015 5:24 pm
by RaTTuS
if you can then set it static on your router - that is the best way IMO ;)

Re: can't set static address

Posted: Thu Nov 05, 2015 3:45 pm
by petercli
i want to set the static ip address on the PI , not on the router.

Anybody have a sample /etc/network/interfaces i can look at ?

Thanks,Peter

Re: can't set static address

Posted: Thu Nov 05, 2015 3:49 pm
by rpdom
Set it in /etc/dhcpcd.conf instead (man dhcpcd.conf and look at the "static" options)

Re: can't set static address

Posted: Thu Nov 05, 2015 4:13 pm
by DougieLawson
Static addresses are now configured in /etc/dhcpcd.conf

Add this stuff at the bottom

Code: Select all

interface eth0
static ip_address=192.168.1.9/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8
and undo your changes to /etc/network/interfaces.