I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to
provide DNS. The main thing required for this to work is to give it a
static IP of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two
systems and that's done. As long as I don't actually run dnsmasq on
the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to
provide DNS. The main thing required for this to work is to give it a
static IP of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two
systems and that's done. As long as I don't actually run dnsmasq on
the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
If your network is set up by systemd, see the directory
/etc/systemd/network.
If the network is set up the traditional way, see the directory /etc/network/interfaces.d.
In article (Dans l'article) <siv8v8$5pc$1@dont-email.me>, Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote (écrivait) :
If your network is set up by systemd, see the directory
/etc/systemd/network.
If the network is set up the traditional way, see the directory
/etc/network/interfaces.d.
On my RPi, I get :
pi@raspberrypi:~ $ ls -al /etc/network/interfaces.d
total 8
drwxr-xr-x 2 root root 4096 jan 30 2017 .
drwxr-xr-x 7 root root 4096 nov 9 2020 ..
pi@raspberrypi:~ $ ls -al /etc/systemd/network
total 8
drwxr-xr-x 2 root root 4096 aoû 31 15:43 .
drwxr-xr-x 5 root root 4096 sep 13 12:43 ..
lrwxrwxrwx 1 root root 9 aoû 31 15:43 99-default.link -> /dev/null
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.60-v7+ #1449 SMP Wed Aug 25 15:00:01 BST 2021
armv7l GNU/Linux
"Chris Green" <cl@isbd.net> wrote in message news:bfeb2i-6s0g.ln1@esprimo.zbmc.eu...
I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to
provide DNS. The main thing required for this to work is to give it a static IP of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two
systems and that's done. As long as I don't actually run dnsmasq on
the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
I'm always cautious of configuring any computer with a static IP address in the device's TCP configuration. It's all too easy to move a portable device onto a different LAN where the static IP may either be in the wrong subnet
or may be within the scope of the LAN's DHCP server and so may, when Sod's Law is in operation, give another device the same address.
Instead, I configure the router to allocate a reserved address (as an IP-to-MAC address mapping) for the devices that I want to have a "static" address. Most modern routers seem to allow reserved IPs to be configured. There is no need for the reserved addresses to be outside the scope of addresses that DHCP hands out.
So you are using DHCP in exactly the same way as a normal (random-IP) setup, but forcing the router's DHCP to give certain devices fixed addresses.
I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to provide
DNS. The main thing required for this to work is to give it a static IP
of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two systems
and that's done. As long as I don't actually run dnsmasq on the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
On Tue, 28 Sep 2021 13:30:03 +0100, Chris Green wrote:
I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to provide DNS. The main thing required for this to work is to give it a static IP
of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two systems and that's done. As long as I don't actually run dnsmasq on the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
I use an even simpler approach to maintain:
I run named to provide a DNS service for my LAN, partly because its
easier to maintain a single central zone file for my LAN than to keep resolv.conf files in sync on all systems on the LAN that need this info
and partly because I could and anyway I wanted to understand the care and feeding of a DNS.
/etc/systemd/resolved.comp is the same on all computers: the IPs listed
in the DNS= and FallbackDNS= lines are:
DNS= my_local_DNS my_ISP's_DNS_resolver
FallbackDNS= My network supplier's DNS resolvers
This file should never need to be modified and is the same on all my computers.
Er, the Pi in quation is also the DHCP server! That's the point,
it's how it gets to know the LAN systems' names.
On Tue, 28 Sep 2021 17:26:41 +0100
Chris Green <cl@isbd.net> wrote:
Er, the Pi in quation is also the DHCP server! That's the point,
it's how it gets to know the LAN systems' names.
There are two ways a DHCP server gets to know the LAN systems'
names. Many (not all) systems send the hostname as part of the DHCP
request, this can be used to updated DNS (trivially easy with dnsmasq, more fiddly otherwise). With dnsmasq it is also possible to specify a name for a MAC address and have it assigned in the DNS to the dynamic or fixed IP address issued by dnsmasq. Similar things are possible with other DHCP and DNS servers but usually the only easy thing is to issue a fixed IP address corresponding to a fixed DNS entry.
Martin Gregorie <martin@mydomain.invalid> wrote:
DNS= my_local_DNS my_ISP's_DNS_resolver
FallbackDNS= My network supplier's DNS resolvers
This file should never need to be modified and is the same on all
my computers.
But this doesn't give you names for the systems on your LAN does it?
I want to be able to ssh freely from desktop (name esprimo) to laptop
(name t470) to Pi (dns) to another Pi (backup) to my wife's laptop
(x201), etc. Running dnsmasq as DHCP/DNS server provides me with this ability easily.
Yes, exactly! It's why I use dnsmasq as the DNS and DHCP server on my
LAN.
Most systems supply a name when getting their IP from the DHCP
server so as a result most systems on my LAN can be called by name
with no extra effort needed from me. A few systems that don't provide
names as you say can be given names in dnsmasq.conf .They're mostly
things like Freeview boxes, a Roku streaming box and an Onko
amplifier, still it's nice to give them names so otherwise anonymous
devices can be identified as "meant to be there".
The canonical way is to run BIND9 and link it with the dhcp server,
Yes, a lot of people like something simpler, but I run a mixed network,
and BIND works with anything, even the wretched Windows. It is, after
all, the reference *nix DNS server.
But this doesn't give you names for the systems on your LAN does it?
I want to be able to ssh freely from desktop (name esprimo) to laptop
(name t470) to Pi (dns) to another Pi (backup) to my wife's laptop
(x201), etc. Running dnsmasq as DHCP/DNS server provides me with this ability easily.
In your situation where you want either the main or the backup Pi to have
the same IP, you could achieve this by tweaking the router's reserved >addresses. Whether it's easier/harder than reconfiguring the static IP at
the backup Pi's TCP settings - well, that's debateable :-)
On Tue, 28 Sep 2021 19:17:57 +0100, Chris Green wrote:
But this doesn't give you names for the systems on your LAN does it?
Yes it does: the name is linked with the IP when you add the new system
to the zone file: the resolved.conf file directs name searches to your
DNS first, so the enquirer gets handed the correct IP by your local DNS:
On Tue, 28 Sep 2021 22:39:10 -0000 (UTC)
Martin Gregorie <martin@mydomain.invalid> wrote:
On Tue, 28 Sep 2021 19:17:57 +0100, Chris Green wrote:
But this doesn't give you names for the systems on your LAN does it?
Yes it does: the name is linked with the IP when you add the new system
to the zone file: the resolved.conf file directs name searches to your
DNS first, so the enquirer gets handed the correct IP by your local DNS:
Right but you have to edit the zone file - it is possible to have
the name supplied as part of the DHCP query added to the DNS for the LAN
with no intervention so that new hosts added to the network get a name in
the DNS without having to edit a zone file.
I have two Pi systems on my LAN here at home, one just provides DNS
using dnsmasq and the other has a big external USB drive for backups.
The DNS Pi has a static IP of 192.168.1.2.
If the DNS Pi dies I want to quickly configure the backup Pi to
provide DNS. The main thing required for this to work is to give it a
static IP of 192.168.1.2 and to configure dnsmasq on it.
Copying the dnsmasq configuration across is easy enough, I can simply synchronise /etc/dnsmasq.conf and /etc/dnsmasq.d between the two
systems and that's done. As long as I don't actually run dnsmasq on
the backup machine all will be well.
So, if/when the DNS Pi dies all I need to do is:-
Configure the backup machine to have a static IP of 192.168.1.2
Copy the dnsmasq.leases file (I'm keeping a live copy of that)
Start dnsmasq
Simple! :-)
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
I have internet access via Orange Belgium.
I have configured the DHCP on the modem (router) with mac addresses
and ip adresses, and so I always got same ip adresses for my
computers. Just info, depend of your environment.
On Thu, 30 Sep 2021 09:12:51 +0200
zeneca <pasIci@ailleur.fr> wrote:
I have internet access via Orange Belgium.
Is the configuration in /etc/dhcpcd.conf *all* that's needed for a
static IP?
I have configured the DHCP on the modem (router) with mac addresses
and ip adresses, and so I always got same ip adresses for my
computers. Just info, depend of your environment.
And over the years, many of us have been let down by domestic-grade
routers, sometimes in subtle ways. Few of us can afford industrial
Cisco kit or the like.
I once used a router for DNS to gain caching from my ISP. One day,
after a couple of frustrating hours, I found it was failing to return
the occasional MX (always the same ones). My BIND was immediately
switched to root hints, less efficient but I know it works every time.
I had one router (several actually) which needed a reboot occasionally,
so I made a small cron script to do it when needed. Thanks to the
vagaries of router signal handling, I ended up checking up to six Net
sites in round-robin, and actually parsing some returned characters from
each one. I couldn't find anything less that would reliably detect the
need to reboot.
So I run BIND9 on root hints, even on my venerable Pi2. It works almost perfectly, except for the Pi apt repository site, which sometimes needs
a couple of tries to get DNS results during update.
On 01/10/2021 10:02, Joe wrote:
I have internet access via Orange Belgium.
I have configured the DHCP on the modem (router) with mac addresses
and ip adresses, and so I always got same ip adresses for my
computers. Just info, depend of your environment.
And over the years, many of us have been let down by domestic-grade routers, sometimes in subtle ways. Few of us can afford industrial
Cisco kit or the like.
I cannot but agree. In the end I ended up with a S/H Cisco SOHO
router - rebadged linksys I think - which was reliable but too much
of a room heater and replaced it with a draytek, which has been 100% reliable, but was around £132 from memory. So not a typical home
router, but frankly if you need the internet thats only a few months broadband bill. I've had D link, Netgear and TP-link routers too -
all have been at one time or another replaced due to flakiness.Ive
got a Netgear whose ADSL performance went suspect after a
thunderstorm in use as a WAP. It still isn't 100% reliable.
And over the years, many of us have been let down by domestic-grade
routers, sometimes in subtle ways. Few of us can afford industrial
Cisco kit or the like.
And over the years, many of us have been let down by domestic-grade
routers, sometimes in subtle ways. Few of us can afford industrial
Cisco kit or the like.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 174:57:20 |
Calls: | 7,915 |
Files: | 12,983 |
Messages: | 5,797,724 |