Shaken_Earth
Posts: 1
Joined: Mon Aug 07, 2017 7:29 pm

ifconfig on RPi 3 not returning an IPv4 address

Mon Aug 07, 2017 7:42 pm

Hi, I've been following this tutorial (https://diyhacking.com/raspberry-pi-web-server/) to set up my Pi as a web server. However, once I use

Code: Select all

ifconfig
to try and find

Code: Select all

inet
,

Code: Select all

Bcast
, and

Code: Select all

Mask
under the

Code: Select all

eth0
section, all I get is an

Code: Select all

inet6
MAC address.

Code: Select all

wlan0
includes all of this information however and I'm of course able to access the server from any device connected to my WiFi router. However, how do I go about getting the proper information from

Code: Select all

eth0
? Thanks in advance!

This is the full information returned by

Code: Select all

ifconfig
:

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:0c:df:b2  
          inet6 addr: fe80::e6d4:d65c:4b80:a222/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0
          TX packets:172 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:14112 (13.7 KiB)  TX bytes:14112 (13.7 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:59:8a:e7 
          inet addr:192.168.86.36  Bcast:192.168.86.255  Mask:255.255.255.0
          inet6 addr: fe80::e28b:9beb:6c8b:60b1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1708 errors:0 dropped:7 overruns:0 frame:0
          TX packets:1670 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1327896 (1.2 MiB)  TX bytes:298195 (291.2 KiB)

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: ifconfig on RPi 3 not returning an IPv4 address

Mon Aug 07, 2017 8:17 pm

You seem to neither have an IPv6 router running, nor an DHCPv4 server. No IPv6 router, because all you get on eth0 is the usual fe80:: IPv6 SLAAC LLA, that's an automatic link-local address. And as you don't see any IPv4 address, then there's also no DHCPv4 server responding on your eth0 network. So what do you want to achieve here at all?
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

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

Re: ifconfig on RPi 3 not returning an IPv4 address

Mon Aug 07, 2017 9:39 pm

Is your RPi connected to anything? Is the cable from eth0 faulty (check for green lights on both ends)? Is dhcpcd still installed and running?

That FE80::e6d4:d65c:4b80:a222/64 IPv6 link-local address is assigned by the Linux kernel when the interface comes up during boot up. I'm surprised you've not got a 169.254.xxx.yyy IPv4 link-local address which is why it looks like dhcpcd may have failed.
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.

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: ifconfig on RPi 3 not returning an IPv4 address

Tue Aug 08, 2017 6:18 am

Just a minor note, as far as I remember having seen the behavior (but I may be wrong): the LLA only appears if eth0 has carrier, but not when it comes up.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

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

Re: ifconfig on RPi 3 not returning an IPv4 address

Tue Aug 08, 2017 8:02 am

elkberry wrote:
Tue Aug 08, 2017 6:18 am
Just a minor note, as far as I remember having seen the behavior (but I may be wrong): the LLA only appears if eth0 has carrier, but not when it comes up.
I'm not sure it works that way for IPv6 which has much better zero configuration options. I've not tested it.
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 “Networking and servers”