TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MARTIN GREGORIE
from: MM0FMF
date: 2018-05-05 21:54:00
subject: Re: Wrong IP address on P

On 05/05/2018 20:54, Martin Gregorie wrote:
> On Sat, 05 May 2018 20:32:00 +0200, Andreas Neumann wrote:
>
>> The hosts file has nothing to do with setting up networking.
>>
> It does if you're not using DNS on your LAN - how else is the system
> making a connection supposed to translate the hostname into an IP?
>
> Also, the combination of the name on hostname and a matching line in
> hosts was the traditional way to tell a system what its IP is.
>
> Another way is to edit /etc/network/interfaces: something like:
>
> auto lo
> iface lo inet loopback
> iface eth0 inet static
> address 192.168.7.101
> netmask 255.255.255.0
> gateway 192.168.7.1
>
> makes the use of static addressing for eth0 explicit and, as part of its
> standard operation, overwrites /etc/hosts
>
>> It only matches host names to IP adresses in a static environment.
>>
> ...static addressing is exactly what said I was describing and did
> describe.
>
> Nothing else is needed for a small LAN and, while most routers can assign
> anonymous IPs via DHCP, many fewer allow hostnames to be associated with
> DHCP-assigned addresses and assigned to specific MACs - something thats
> needed if your local machines are to talk to each other.
>
> If your router won't do that but your hosts need to communicate, your
> choices are:
>
> a) use static assignment via /etc/hosts
>
> b) set up your own DHCP server on a suitable PC or RPi
>
> c) set up a local DNS on a suitable PC or RPi
>
> and option (a) is a lot easier to install and configure than (b) or (c).
>
>

The OP's question was why the IP address was unexpectedly 169.254.x.x
and that is a big indication that there is no static IP set and DHCP is
not giving the Pi an IP addr.

Whilst the OP may have asked about how to get an IP addr in the range he
expected, the fact he doesn't grok what a 169.254 address signifies is
the question that needs answering. viz. why isn't DHCP working. The most
likely reason is because networking is actually not working.

Get networking working then you can fanny about with hostnames but
again, the original question is framed in such a way that the OP is
expecting to access the Pi by an addr not a name.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.