petercli
Posts: 21
Joined: Sun Nov 01, 2015 7:49 pm

can't set static address

Wed Nov 04, 2015 4:36 pm

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

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: can't set static address

Wed Nov 04, 2015 5:24 pm

if you can then set it static on your router - that is the best way IMO ;)
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

petercli
Posts: 21
Joined: Sun Nov 01, 2015 7:49 pm

Re: can't set static address

Thu Nov 05, 2015 3:45 pm

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

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: can't set static address

Thu Nov 05, 2015 3:49 pm

Set it in /etc/dhcpcd.conf instead (man dhcpcd.conf and look at the "static" options)

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: can't set static address

Thu Nov 05, 2015 4:13 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”