-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
[Solved] Raspbian Stretch: Setting a static IP
Hello everyone,
I recently aquired a Pi3 and now set it up with the new stretch image. I need to assign it a static IP, but none of the ways the internet has told me has worked. It always either was not reachable from outside or couldn't even reach Google (8.8.8.8).
Is there a reliable way to tell the pi to have a static IP?
BTW, my router doesn't support that so I have to do it from the pi.
Thanks in advance for any help.
I recently aquired a Pi3 and now set it up with the new stretch image. I need to assign it a static IP, but none of the ways the internet has told me has worked. It always either was not reachable from outside or couldn't even reach Google (8.8.8.8).
Is there a reliable way to tell the pi to have a static IP?
BTW, my router doesn't support that so I have to do it from the pi.
Thanks in advance for any help.
Last edited by Robbi_Blechdose on Sat Aug 19, 2017 9:02 am, edited 1 time in total.
Re: Raspbian Stretch: Setting a static IP
Hi.
Setting a static IP in stretch has changed because the eth0 is replace by the new enx format.
so first find what your eth0 is now called by doing
this is mine
so you can see eth0 is now enxb827ebdc0d1f in my case
and the my ip is 192.168.1.15 which my static IP I set.
so edit dhcpcd.conf with
so you add your static ip settings to the end if the file like this
using the new name for eth0.
hope this helps.
Setting a static IP in stretch has changed because the eth0 is replace by the new enx format.
so first find what your eth0 is now called by doing
Code: Select all
ifconfig
Code: Select all
enxb827ebdc0d1f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.15 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::1712:8263:d0d9:c187 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:dc:0d:1f txqueuelen 1000 (Ethernet)
RX packets 400 bytes 41204 (40.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 273 bytes 55706 (54.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:89:58:4a txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
and the my ip is 192.168.1.15 which my static IP I set.
so edit dhcpcd.conf with
Code: Select all
sudo nano /etc/dhcpcd.conf
Code: Select all
#static IP configuration
interface enxb827ebdc0d1f
static ip_address=192.168.1.15/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
hope this helps.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
Re: Raspbian Stretch: Setting a static IP
Thanks for the help,
but (I should have clarified that) I'd like to set it for wlan0 as I'm using the Pi3's wifi.
but (I should have clarified that) I'd like to set it for wlan0 as I'm using the Pi3's wifi.
Re: Raspbian Stretch: Setting a static IP
Change the interface name to 'wlan0'Robbi_Blechdose wrote: ↑Sat Aug 19, 2017 7:23 amThanks for the help,
but (I should have clarified that) I'd like to set it for wlan0 as I'm using the Pi3's wifi.
-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
Re: Raspbian Stretch: Setting a static IP
I already tried that approach, and it completely shot the networking on the pi until I changed the config back.
Are you sure that that is the correct way?
Are you sure that that is the correct way?
Re: Raspbian Stretch: Setting a static IP
Did you make changes to other network related files, like /etc/network/interfaces?
BTW: if you use Raspbian desktop version then you should be able to set the static IP from the panel applet.
BTW: if you use Raspbian desktop version then you should be able to set the static IP from the panel applet.
-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
Re: Raspbian Stretch: Setting a static IP
Nope, didn't do any other changes. Fresh install.
And even the applet breaks everything.
EDIT: Just looked at the sticky wifi topic, might help saying that these lines are missing in /etc/network/interfaces:
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
And even the applet breaks everything.

EDIT: Just looked at the sticky wifi topic, might help saying that these lines are missing in /etc/network/interfaces:
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Re: Raspbian Stretch: Setting a static IP
Networking seems to have been totally messed up in stretch, so much so I don't plan to use it for anything in the near future until its been sorted.
As others have noted even putting fix in place to return to old port identifications messes up the wan port naming/visability.
can't comment on setting static IP on Wi-Fi as I don't use it on my pi's since I moved to Jessie, the only pi I have using Wi-Fi is on my rover and that's still running wheezy.
As others have noted even putting fix in place to return to old port identifications messes up the wan port naming/visability.
can't comment on setting static IP on Wi-Fi as I don't use it on my pi's since I moved to Jessie, the only pi I have using Wi-Fi is on my rover and that's still running wheezy.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
Re: Raspbian Stretch: Setting a static IP
So I'll probably switch back to Jessie where the networking works properly. Thanks for the help anyway.
EDIT: It appears that Strech fixed an exploit in the wifi chip, so Jessie is not an option.
EDIT: It appears that Strech fixed an exploit in the wifi chip, so Jessie is not an option.

-
- Posts: 83
- Joined: Sat Sep 20, 2014 6:11 pm
Re: Raspbian Stretch: Setting a static IP
Managed to fix it: I was giving it an xxx.xxx.10.xxx IP when all other IPs are xxx.xxx.2.xxx. It's now working.
Re: Raspbian Stretch: Setting a static IP
Hi,pcmanbob wrote: ↑Fri Aug 18, 2017 9:08 pm
so edit dhcpcd.conf withso you add your static ip settings to the end if the file like thisCode: Select all
sudo nano /etc/dhcpcd.conf
Code: Select all
#static IP configuration interface enxb827ebdc0d1f static ip_address=192.168.1.15/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1
I've made the recommended changes to the dhcpd.conf file and it still reboots on DHCP (the file is saved and I'm using my adaptor's ID in enx format)
Am I missing any further step?
Using Raspbian Stretch as of Sep 6, 2017.
Thank you.
Re: [Solved] Raspbian Stretch: Setting a static IP
If that is the interface name you used for your ethernet interface, it probably won't work. That is pcmanbob's interface name. You must get YOUR ethernet interface name. You can find your interface name with ifconfig.
My advice applies to RaspiOS only. Please mention if you use another OS.
-
- Posts: 1009
- Joined: Mon Oct 31, 2016 10:05 am
Re: [Solved] Raspbian Stretch: Setting a static IP
And this is progress???You can find your interface name with ifconfig.
If this post appears in the wrong forums category, my apologies.
Re: [Solved] Raspbian Stretch: Setting a static IP
I don't know. I'm flexible and can deal with it.Martin Frezman wrote:And this is progress???You can find your interface name with ifconfig.
My advice applies to RaspiOS only. Please mention if you use another OS.
Re: [Solved] Raspbian Stretch: Setting a static IP
I agree with you making such a change of a device designed for educational / beginner use was in my opinion a bad move it probably broke many how tos and ready made scripts.Martin Frezman wrote: ↑Fri Sep 08, 2017 4:22 pmAnd this is progress???You can find your interface name with ifconfig.
But as has already been stated on the forum in several threads the next release/update of stretch will revert to the old naming.
I believe the next release is available now but I have not checked it yet.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: [Solved] Raspbian Stretch: Setting a static IP
Is this going to require more than an update and upgrade? I just did that and the funny interface names are still there.
My advice applies to RaspiOS only. Please mention if you use another OS.
Re: [Solved] Raspbian Stretch: Setting a static IP
updating from Jessie to stretch did not change to the new interface naming only a fresh install made the change, so I suspect to revert to the old interface naming you will need a fresh install of stretch.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported
The use of crystal balls & mind reading are not supported
Re: [Solved] Raspbian Stretch: Setting a static IP
I have a spare SD card. I'll give it a try.
My advice applies to RaspiOS only. Please mention if you use another OS.
-
- Posts: 1009
- Joined: Mon Oct 31, 2016 10:05 am
Re: [Solved] Raspbian Stretch: Setting a static IP
Or you just fix it yourself. The "net.ifnames=0" method is the most obvious.
If this post appears in the wrong forums category, my apologies.
Re: [Solved] Raspbian Stretch: Setting a static IP
The latest Stretch image has the weird net names thing disabled. I booted up a Pi 3B with Stretch Lite 07/09/2017 today and it had eth0 as the main interface.
Re: [Solved] Raspbian Stretch: Setting a static IP
I booted 2017-09-07-Stretch/Pixel and the interfaces have the familiar names (eth0, wlan0).
Not only that, it appears to have corrected the wlan0/wlan1 problem I had. The usb wifi was coming up as wlan0 on boot. Now it comes up as wlan1. I set up my two wifi devices (one as an AP, the other as a client that provides internet access), and it works now.
Not only that, it appears to have corrected the wlan0/wlan1 problem I had. The usb wifi was coming up as wlan0 on boot. Now it comes up as wlan1. I set up my two wifi devices (one as an AP, the other as a client that provides internet access), and it works now.
My advice applies to RaspiOS only. Please mention if you use another OS.
Re: [Solved] Raspbian Stretch: Setting a static IP
how about i dont have usb lan?,, i just want to use wlan0 as static ip(hostapd, dnsmasq)?
having a problem on dnsmasq .. "unknown interface wlan0"
thanks
having a problem on dnsmasq .. "unknown interface wlan0"
thanks
Re: [Solved] Raspbian Stretch: Setting a static IP
@bhong2002: Post the output of ifconfig. Are you trying to set up an access point?
My advice applies to RaspiOS only. Please mention if you use another OS.