Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

General discussion • Re: Need to set fixed IP on eth0 on new RPi4, how?

$
0
0
Bookworm doesn't use dhcpcd, it uses Network Manager.
I don't really know how that is managed, I just want to set the fixed IP on this new RPi4.
For RPiOS post October 2024 you will have to install ifupdown from apt first.
What does that do?
But why not use Network Manager? sudo nmtui then follow the prompts to edit or create a connection.
Did not know about this...
But I have now tested it and it brought up a character based form, which I have filled in as best I could to configure eth0:

Code:

│         Profile name Wired connection 1______________________        ││               Device eth0 (DC:A6:32:34:83:F8)________________        ││                                                                      ││ ═ ETHERNET                                                    <Show> ││ ═ 802.1X SECURITY                                             <Show> ││                                                                      ││ ╤ IPv4 CONFIGURATION <Automatic>                              <Hide> ││ │          Addresses 192.168.113.171__________ <Remove>              ││ │                    <Add...>                                        ││ │            Gateway 192.168.113.1____________                       ││ │        DNS servers 192.168.113.1____________ <Remove>              ││ │                    212.186.211.21___________ <Remove>              ││ │                    195.58.161.123___________ <Remove>              ││ │                    <Add...>                                        ││ │     Search domains <Add...>                                        ││ │                                                                    ││ │            Routing (No custom routes) <Edit...>                    ││ │ [ ] Never use this network for default route                       ││ │ [ ] Ignore automatically obtained routes                           ││ │ [ ] Ignore automatically obtained DNS parameters                   ││ │                                                                    ││ │ [X] Require IPv4 addressing for this connection                    ││ └                                                                    ││                                                                      ││ ╤ IPv6 CONFIGURATION <Disabled>                               <Hide> ││ │          Addresses <Add...>                                        ││ │            Gateway _________________________                       ││ │        DNS servers <Add...>                                        ││ │     Search domains <Add...>                                        ││ │            Routing (No custom routes) <Edit...>                    ││ │ [ ] Never use this network for default route                       ││ │ [ ] Ignore automatically obtained routes                           ││ │ [ ] Ignore automatically obtained DNS parameters                   ││ │                                                                    ││ │ [ ] Require IPv6 addressing for this connection                    ││ └                                                                    │
I have used this on the device to be replaced to get the data to enter:

Code:

$ cat /etc/resolv.conf# Generated by resolvconfdomain homenameserver 212.186.211.21nameserver 195.58.161.123
Does this look anything like what I need?
My aim is to set up eth0 with the IPv4 address 192.168.113.171 and disable IPv6 altogether.
I will not touch wifi because that is what I use when I am now working on the device.
Or, as you appear to have done in the past, reserve and IP address against the MAC address of the Pi's interface on your router/DHCP server.
Well, the RPi I am building is supposed to be used in Vienna whereas I am in Stockholm.
I have no possibility to configure anything on the target location router, so that is out.
The reservation of the IP in question will remain but since that device will no longer be running it is a free IP to use and is what is used by the router's port forward settings.
The new RPi will perform the same tasks as the old did so if I can set it up over here to start up NOT using DHCP but instead have a fixed IP address set to its ethernet connection we are in business...
But I am a bit wondering about the other info needed like

Is there some way I could set it up such that the eth0 connection is given a fixed address on my own home LAN while I am testing it and then before shipping I come back to the nmtui dialog and modify the IP address only?

LATER AFTER MORE THINKING:
I think I will skip this step of reusing the existing IP address, just go ahead and let the RPi get whatever address on the new location.
Then when that is known a reservation can be done in the DHCP server on the router and port forwards added for this new VPN server.
In that way the old one can remain on-line too if a different incoming port on the router is used.

It will mean that "someone" on location has to be able to go into the router's config and lock a reservation for the new device's IP address and add the port forward to that IP in parallel with the old. Then there will be a backup VPN channel until the old unreliable RPi2 is scrapped.

Statistics: Posted by Bosse_B — Thu Mar 27, 2025 10:33 pm



Viewing all articles
Browse latest Browse all 8609

Trending Articles