:: Re: [DNG] Refracta have a static IP
Página Principal
Delete this message
Reply to this message
Autor: Arnt Karlsen
Data:  
Para: dng
Assunto: Re: [DNG] Refracta have a static IP
On Tue, 13 Jul 2021 16:41:06 -0400, Steve wrote in message
<20210713164106.41efdf96@???>:

> Hi all,
>
> I'm trying to make my new Chimera based Refracta have a static IP
> address at 192.168.0.199/24, in order that every other computer on the
> 192.168.0.0/24 subnet can easily access it, and so I can put it on my
> LAN DNS.
>
> So I made my /etc/network/interfaces look like the following, which
> follows the guidelines of "man interfaces":
>
> =======================================
> auto lo
> iface lo inet loopback
>
> allow-hotplug eth0
> iface eth0 inet static
> address 192.168.0.199


..could this be as simple as:
address 192.168.0.199/24 #??? It shouldn't be.

> gateway 192.168.0.1
> =======================================
>
> Unfortunately, instead of the IP address being 192.168.0.199, it's a
> DHCP supplied 192.168.0.204 . What additional steps must I take to get
> my desired 192.168.0.199?
>
> Additional note: When I used 192.168.0.40, which I KNOW is not in my
> leased DHCP range, the result was the same. What must I do to get a
> static IP at 192.168.0.199/24 ?



..many ways: https://duckduckgo.com/?q=Devuan+fixed+ip+on+dhcp&ia=web
or https://duckduckgo.com/?q=Devuan+static+ip+on+dhcp&ia=web all shows
various ways to set up your dhcp client to request a specific ip, or
have your dhcp server deliver a specific ip address to a specific mac
address on that dhcp client. Etc.

..note that any of those servers or clients on your lan "may have"
caches or cached settings that you "may" wanna clean out. ;o)

..also, if you haven't set up ipv6, that too might mess up your lan.

..your problem looks quite a bit like:
https://unix.stackexchange.com/questions/85047/losing-static-ip-and-and-getting-dhcp-ip

..e.g. /etc/dhcpcd.conf from link above:
# /etc/dhcpcd.conf
# to stop all my NICs from getting the DHCP address
# above any configured interface: (I am using 2 NICs
# both set at eth0 and eth1)

denyinterfaces eth0 eth1

...and #: /etc/init.d/networking restart

..a neater way, once everything works ok:
https://www.linuxquestions.org/questions/linux-networking-3/alternating-between-dhcp-and-a-static-address-depending-on-availability-4175676466/


..the classic way, way down: https://tldp.org/HOWTO/DHCP/x74.html
at: 3.11. Alternative DHCP client (ISC dhclient):

...create a /etc/dhclient.conf file with this example configuration.

interface "eth0" {
send dhcp-client-identifier 1:xx:xx:xx:xx:xx:xx;
# send dhcp-lease-time 86400;
}

Here we assume that the ethernet interface is eth0. If not change
accordingly. Also replace xx:xx:xx:xx:xx with your ethernet address."

..classic serverside way: https://tldp.org/HOWTO/DHCP/x369.html where
you want: "You can also assign specific IP addresses based on clients
ethernet address e.g.

host haagen {
hardware ethernet 08:00:2b:4c:59:23;
fixed-address 192.168.1.222;
}

This will assign IP address 192.168.1.222 to a client with ethernet
address 08:00:2b:4c:59:23."

..aaaand, I found out why I found myself searching for "fixed",
rather than "static." ;o)

--
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
Scenarios always come in sets of three:
best case, worst case, and just in case.