From 3f1945c1ed72720b86434286ea82798ad14a85b2 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 2 Oct 2023 16:54:58 +0200 Subject: [PATCH] dnsmasq configuration added --- 10_do_not_listen_to_internet_vlan.conf | 3 +++ 20_common.conf | 27 ++++++++++++++++++++++++++ 40_dhcp_vlan20_definition.conf | 10 ++++++++++ 40_dhcp_vlan30_definition.conf | 10 ++++++++++ 40_dhcp_vlan40_definition.conf | 10 ++++++++++ 40_dhcp_vlan50_definition.conf | 10 ++++++++++ 40_dhcp_vlan60_definition.conf | 10 ++++++++++ 60_create_leases_file.conf | 7 +++++++ 70_cnames.conf | 15 ++++++++++++++ 80_static_ip.conf | 5 +++++ 99_debug.conf_ | 6 ++++++ 11 files changed, 113 insertions(+) create mode 100644 10_do_not_listen_to_internet_vlan.conf create mode 100644 20_common.conf create mode 100644 40_dhcp_vlan20_definition.conf create mode 100644 40_dhcp_vlan30_definition.conf create mode 100644 40_dhcp_vlan40_definition.conf create mode 100644 40_dhcp_vlan50_definition.conf create mode 100644 40_dhcp_vlan60_definition.conf create mode 100644 60_create_leases_file.conf create mode 100644 70_cnames.conf create mode 100644 80_static_ip.conf create mode 100644 99_debug.conf_ diff --git a/10_do_not_listen_to_internet_vlan.conf b/10_do_not_listen_to_internet_vlan.conf new file mode 100644 index 0000000..f1a67b5 --- /dev/null +++ b/10_do_not_listen_to_internet_vlan.conf @@ -0,0 +1,3 @@ +# Or you can specify which interface _not_ to listen on +except-interface=eth0.10 + diff --git a/20_common.conf b/20_common.conf new file mode 100644 index 0000000..4d18b18 --- /dev/null +++ b/20_common.conf @@ -0,0 +1,27 @@ +# Set the DHCP server to authoritative mode. In this mode it will barge in +# and take over the lease for any client which broadcasts on the network, +# whether it has a record of the lease or not. This avoids long timeouts +# when a machine wakes up on a new network. DO NOT enable this if there's +# the slightest chance that you might end up accidentally configuring a DHCP +# server for your campus/company accidentally. The ISC server uses +# the same option, and this URL provides more information: +# http://www.isc.org/files/auth.html +dhcp-authoritative + +# Add local-only domains here, queries in these domains are answered +# from /etc/hosts or DHCP only. +local=/home/ + +# Set this (and domain: see below) if you want to have a domain +# automatically added to simple names in a hosts-file. +expand-hosts + +# Set the domain for dnsmasq. this is optional, but if it is set, it +# does the following things. +# 1) Allows DHCP hosts to have fully qualified domain names, as long +# as the domain part matches this setting. +# 2) Sets the "domain" DHCP option thereby potentially setting the +# domain of all systems configured by DHCP +# 3) Provides the domain part for "expand-hosts" +domain=home + diff --git a/40_dhcp_vlan20_definition.conf b/40_dhcp_vlan20_definition.conf new file mode 100644 index 0000000..e69d6fe --- /dev/null +++ b/40_dhcp_vlan20_definition.conf @@ -0,0 +1,10 @@ +# Uncomment this to enable the integrated DHCP server, you need +# to supply the range of addresses available for lease and optionally +# a lease time. If you have more than one network, you will need to +# repeat this for each network on which you want to supply DHCP +# service. +dhcp-range=VLAN20,192.168.20.50,192.168.20.150,12h + +dhcp-option=VLAN20,option:router,192.168.20.1 + +dhcp-option=VLAN20,option:dns-server,192.168.20.1 diff --git a/40_dhcp_vlan30_definition.conf b/40_dhcp_vlan30_definition.conf new file mode 100644 index 0000000..adb98e5 --- /dev/null +++ b/40_dhcp_vlan30_definition.conf @@ -0,0 +1,10 @@ +# Uncomment this to enable the integrated DHCP server, you need +# to supply the range of addresses available for lease and optionally +# a lease time. If you have more than one network, you will need to +# repeat this for each network on which you want to supply DHCP +# service. +dhcp-range=192.168.30.50,192.168.30.150,12h + +dhcp-option=option:router,192.168.30.1 + +dhcp-option=option:dns-server,192.168.30.1 diff --git a/40_dhcp_vlan40_definition.conf b/40_dhcp_vlan40_definition.conf new file mode 100644 index 0000000..702f9fe --- /dev/null +++ b/40_dhcp_vlan40_definition.conf @@ -0,0 +1,10 @@ +# Uncomment this to enable the integrated DHCP server, you need +# to supply the range of addresses available for lease and optionally +# a lease time. If you have more than one network, you will need to +# repeat this for each network on which you want to supply DHCP +# service. +dhcp-range=VLAN40,192.168.40.50,192.168.40.150,12h + +dhcp-option=VLAN40,option:router,192.168.40.1 + +dhcp-option=VLAN40,option:dns-server,192.168.40.1 diff --git a/40_dhcp_vlan50_definition.conf b/40_dhcp_vlan50_definition.conf new file mode 100644 index 0000000..1a8d46c --- /dev/null +++ b/40_dhcp_vlan50_definition.conf @@ -0,0 +1,10 @@ +# Uncomment this to enable the integrated DHCP server, you need +# to supply the range of addresses available for lease and optionally +# a lease time. If you have more than one network, you will need to +# repeat this for each network on which you want to supply DHCP +# service. +dhcp-range=VLAN50,192.168.50.50,192.168.50.150,12h + +dhcp-option=VLAN50,option:router,192.168.50.1 + +dhcp-option=VLAN50,option:dns-server,192.168.50.1 diff --git a/40_dhcp_vlan60_definition.conf b/40_dhcp_vlan60_definition.conf new file mode 100644 index 0000000..2858670 --- /dev/null +++ b/40_dhcp_vlan60_definition.conf @@ -0,0 +1,10 @@ +# Uncomment this to enable the integrated DHCP server, you need +# to supply the range of addresses available for lease and optionally +# a lease time. If you have more than one network, you will need to +# repeat this for each network on which you want to supply DHCP +# service. +dhcp-range=VLAN60,192.168.60.50,192.168.60.150,12h + +dhcp-option=VLAN60,option:router,192.168.60.1 + +dhcp-option=VLAN60,option:dns-server,192.168.60.1 diff --git a/60_create_leases_file.conf b/60_create_leases_file.conf new file mode 100644 index 0000000..34505b9 --- /dev/null +++ b/60_create_leases_file.conf @@ -0,0 +1,7 @@ +# The DHCP server needs somewhere on disk to keep its lease database. +# This defaults to a sane location, but if you want to change it, use +# the line below. +dhcp-leasefile=/var/lib/misc/dnsmasq.leases + +# Set the cachesize here. +cache-size=4096 diff --git a/70_cnames.conf b/70_cnames.conf new file mode 100644 index 0000000..9a5dc3e --- /dev/null +++ b/70_cnames.conf @@ -0,0 +1,15 @@ +# firewall.home +cname=fw.home,firewall.home +cname=dns.home,firewall.home +cname=dhcp.home,firewall.home +cname=tv.home,firewall.home + +# multimedia.home +cname=smart.home,multimedia.home +cname=mqtt.home,multimedia.home +cname=scan.home,multimedia.home +cname=gfw.home,multimedia.home + +# mfc-j5330dw.home +cname=brother.home,mfc-j5330dw.home + diff --git a/80_static_ip.conf b/80_static_ip.conf new file mode 100644 index 0000000..292bed2 --- /dev/null +++ b/80_static_ip.conf @@ -0,0 +1,5 @@ +# brother.home (BRNB422006223E2) +# LAN +# dhcp-host=b4:22:00:62:23:e2,mfc-j5330dw,192.168.0.10 +# WLAN +dhcp-host=c8:94:02:b3:81:69,mfc-j5330dw,192.168.30.10 diff --git a/99_debug.conf_ b/99_debug.conf_ new file mode 100644 index 0000000..ec8ae27 --- /dev/null +++ b/99_debug.conf_ @@ -0,0 +1,6 @@ +# For debugging purposes, log each DNS query as it passes through +# dnsmasq. +#log-queries + +# Log lots of extra information about DHCP transactions. +#log-dhcp