1

Usually when I connect my raspberry pi to my laptop using an ethernet cable, the ifconfig command in each computer would show the ipaddress of each computer under eth0.

I recently got a new raspberry pi and so I decided to attach all three machines (1 laptop and two Rpi) to a switch hoping to connect all three computers. However what happened was that somehow the dhcp or something else got messed up and now the ifconfig command does not show the ip address for all three computers.

I spent a lot of time googling and trying to fix the problem but no results so far.

My /etc/network/interfaces file is:

#interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto etho0
iface eth0 inet dhcp

I also tried using: sudo dhclient eth0

But the only thing that came out was eth0:avahi which is not what I want.

This is the output of ifconfig on my laptop:

eth0      Link encap:Ethernet  HWaddr 28:d2:44:c4:78:d4  
          inet6 addr: fe80::2ad2:44ff:fec4:78d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5130 (5.1 KB)  TX bytes:21915 (21.9 KB)

eth0:avahi Link encap:Ethernet  HWaddr 28:d2:44:c4:78:d4  
          inet addr:169.254.10.171  Bcast:169.254.255.255      
          Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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:955 errors:0 dropped:0 overruns:0 frame:0
          TX packets:955 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:79278 (79.2 KB)  TX bytes:79278 (79.2 KB)

wlan0     Link encap:Ethernet  HWaddr f8:16:54:08:b8:76  
          inet addr:192.168.1.89  Bcast:192.168.1.255    
          Mask:255.255.255.0
          inet6 addr: fe80::fa16:54ff:fe08:b876/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10485 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6857 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6008707 (6.0 MB)  TX bytes:1305683 (1.3 MB)

Any suggestions as to how I might fix this problem?

  • 3
    "auto etho0" should be "auto eth0" is that a typo here, or also in your config? – cpugeniusmv Apr 12 '15 at 14:04
  • Where is DHCP server? Can he leases two IPs ? – Archemar Apr 12 '15 at 15:20
2
eth0      Link encap:Ethernet  HWaddr 28:d2:44:c4:78:d4  
          inet6 addr: fe80::2ad2:44ff:fec4:78d4/64 Scope:Link
          ^^^^^       ^^^^^^^^^^^^^^^^^^^^^^^^^

That's an IPv6 address. They don't look the same as IPv4 ones.

It's a link-local address based on the MAC address (first line -- notice the last three bytes are the same, and the first three bytes of the MAC are there too, although one of them is slightly altered). Apparently these are mandatory for IPv6 connections, but you could/should have another DHCP assigned address as well.

So, you could just disable IPv6, but that will probably not solve your problem.

  • 1
    But should't I get back the ip4 address as well? – user22119 Apr 12 '15 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.