tachtler:dns_isc_bind_centos_6_-_master-slave_und_tsig
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
tachtler:dns_isc_bind_centos_6_-_master-slave_und_tsig [2012/08/06 12:56] – [/etc/named.conf] klaus | tachtler:dns_isc_bind_centos_6_-_master-slave_und_tsig [2012/12/19 13:15] (aktuell) – [Konstellationsbeschreibung] klaus | ||
---|---|---|---|
Zeile 17: | Zeile 17: | ||
< | < | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Zeile 208: | Zeile 208: | ||
key " | key " | ||
- | algorithm hmac-md5; | + | algorithm hmac-sha256; |
secret " | secret " | ||
}; | }; | ||
Zeile 329: | Zeile 329: | ||
match-clients { key intra. ; " | match-clients { key intra. ; " | ||
// Only following destination can resolv the zon informations. | // Only following destination can resolv the zon informations. | ||
- | match-destinations { " | + | match-destinations { key intra. ; " |
// Allow transfer for server with key. | // Allow transfer for server with key. | ||
Zeile 469: | Zeile 469: | ||
key " | key " | ||
- | algorithm hmac-md5; | + | algorithm hmac-sha256; |
secret " | secret " | ||
}; | }; | ||
Zeile 498: | Zeile 498: | ||
// Only following clients can resolv the zone informations. | // Only following clients can resolv the zone informations. | ||
match-clients { key intra. ; " | match-clients { key intra. ; " | ||
- | ... | + | // Only following destination can resolv the zon informations. |
+ | match-destinations { key intra. ; " | ||
// Allow transfer for server with key. | // Allow transfer for server with key. | ||
- | server 192.168.1.1 { keys intra. ; }; | + | server 192.168.0.1 { keys intra. ; }; |
... | ... | ||
</ | </ | ||
Zeile 684: | Zeile 686: | ||
key " | key " | ||
- | algorithm hmac-md5; | + | algorithm hmac-sha256; |
secret " | secret " | ||
}; | }; | ||
Zeile 805: | Zeile 807: | ||
match-clients { key intra. ; " | match-clients { key intra. ; " | ||
// Only following destination can resolv the zon informations. | // Only following destination can resolv the zon informations. | ||
- | match-destinations { " | + | match-destinations { key intra. ; " |
// Allow transfer for server with key. | // Allow transfer for server with key. | ||
Zeile 946: | Zeile 948: | ||
key " | key " | ||
- | algorithm hmac-md5; | + | algorithm hmac-sha256; |
secret " | secret " | ||
}; | }; | ||
Zeile 955: | Zeile 957: | ||
:!: **WICHTIG** - **Der Einsatz eines TSIG-Schlüssels ist bei der hier vorgestellten Konstellation des Zonen-Transfers entscheidend und wird nachfolgend behandelt: | :!: **WICHTIG** - **Der Einsatz eines TSIG-Schlüssels ist bei der hier vorgestellten Konstellation des Zonen-Transfers entscheidend und wird nachfolgend behandelt: | ||
- | * **FIXME** | + | * [[tachtler: |
=== Definitionen der " | === Definitionen der " | ||
Zeile 975: | Zeile 977: | ||
// Only following clients can resolv the zone informations. | // Only following clients can resolv the zone informations. | ||
match-clients { key intra. ; " | match-clients { key intra. ; " | ||
- | ... | + | // Only following destination can resolv the zon informations. |
+ | match-destinations { key intra. ; " | ||
// Allow transfer for server with key. | // Allow transfer for server with key. | ||
server 192.168.0.20 { keys intra. ; }; | server 192.168.0.20 { keys intra. ; }; | ||
Zeile 1054: | Zeile 1058: | ||
* [[http:// | * [[http:// | ||
+ | ==== Erstellen ==== | ||
+ | Um einen TSGI-Schlüssel(paar) zu erstellen, kann nachfolgender Befehl genutzt werden: | ||
+ | < | ||
+ | # dnssec-keygen -a hmac-sha256 -b 128 -n HOST intra. | ||
+ | Kintra.+163+32328 | ||
+ | </ | ||
+ | //* Die Generierung kann einige Zeit in Anspruch nehmen, je nach Leistungsfähigkeit des Servers.// | ||
+ | |||
+ | Anschließend sollten zwei Dateien entstanden sein, was mit nachfolgendem Befehl überprüft werden kann: | ||
+ | < | ||
+ | # ls -la *intra.* | ||
+ | -rw-r--r-- 1 root root 49 Aug 6 14:15 Kintra.+163+32328.key | ||
+ | -rw------- 1 root root 168 Aug 6 14:15 Kintra.+163+32328.private | ||
+ | </ | ||
+ | |||
+ | Hier ist nur die Datei | ||
+ | * **'' | ||
+ | interessant, | ||
+ | <code ini> | ||
+ | # cat Kintra.+163+32328.private | ||
+ | Private-key-format: | ||
+ | Algorithm: 163 (HMAC_SHA256) | ||
+ | Key: kfgHKkh27TApI3pD+z2GIB== | ||
+ | Bits: AAA= | ||
+ | Created: 20120806121239 | ||
+ | Publish: 20120806121239 | ||
+ | Activate: 20120806121239 | ||
+ | </ | ||
+ | |||
+ | :!: **HINWEIS** - Hier kann nun die **" | ||
+ | |||
+ | Die Dateien selbst, können gelöscht werden, was mit nachfolgendem Befehl durchgeführt werden kann: | ||
+ | < | ||
+ | # rm Kintra.+163+32328.* | ||
+ | </ | ||
+ | |||
+ | ==== Verwenden ==== | ||
+ | |||
+ | Nun muss die jeweilige Konfigurationsdatei | ||
+ | * **''/ | ||
+ | des | ||
+ | * **Master**-Servers und des | ||
+ | * **Slave**-Servers | ||
+ | um nachfolgende Zeilen erweitert werden, damit dem jeweiligen Server der **gleiche TSIG-Schlüssel** bekannt ist und verwendet werden kann (**nur relevanter Ausschnitt**): | ||
+ | <code ini> | ||
+ | ... | ||
+ | key " | ||
+ | algorithm hmac-sha256; | ||
+ | secret " | ||
+ | }; | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ===== Log-Datei des Zonen-Transfers ===== | ||
+ | |||
+ | Zur Überprüfung, | ||
+ | * **''/ | ||
+ | auf dem **Slave**-Server, | ||
+ | < | ||
+ | ... | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 2459 bytes, 0.003 secs (819666 bytes/sec) | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 06-Aug-2012 14: | ||
+ | 6 records, 306 bytes, 0.001 secs (306000 bytes/sec) | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ==== Fehlersuche ==== | ||
+ | |||
+ | Falls ein Fehler, wie nachfolgend dargestellt (**nur relevanter Ausschnitt**), | ||
+ | < | ||
+ | ... | ||
+ | 06-Aug-2012 13: | ||
+ | (source 192.168.1.1# | ||
+ | ... | ||
+ | </ | ||
+ | in der Log-Datei auftreten sollte und der **Zonen-Transfer**, | ||
+ | - Ist der generierte Schlüssel korrekt erstellt worden? | ||
+ | - Ist der **Name** des generierten Schlüssels (hier z.B. **intra.**), | ||
+ | - Sind die **Views** korrekt konfiguriert? | ||
+ | - z.B. Zone - **ohne** - TSIG, wie z.B. '' | ||
+ | - < | ||
+ | - < | ||
+ | - z.B. Zone - **mit** - TSIG, wie z.B. '' | ||
+ | - < | ||
+ | - < | ||
+ | - **Master**-Server -> < | ||
+ | - **Slave**-Server -> < | ||
+ | |||
+ | ===== Zonen-Transfer über NAT-Firewall ===== | ||
+ | |||
+ | Um einen **Zonen-Transfer** über eine Firewall, welche z.B. bei alle ausgehenden Verbindungen, | ||
+ | * :!: **VOR** :!: | ||
+ | der **MASQUERADING**-Regel einzufügen: | ||
+ | |||
+ | Um die aktuellen '' | ||
+ | < | ||
+ | # iptables -t nat -nvL --line-numbers | ||
+ | Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) | ||
+ | num pkts bytes target | ||
+ | |||
+ | Chain POSTROUTING (policy ACCEPT 980 packets, 82233 bytes) | ||
+ | num pkts bytes target | ||
+ | 1 | ||
+ | |||
+ | Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) | ||
+ | num pkts bytes target | ||
+ | </ | ||
+ | |||
+ | Nachfolgende Befehle, fügen folgende '' | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | und hier die Befehle: | ||
+ | < | ||
+ | # iptables -I POSTROUTING 1 -s 192.168.1.1/ | ||
+ | # iptables -I POSTROUTING 1 -s 192.168.1.1/ | ||
+ | # iptables -I OUTPUT 1 -s 192.168.1.1/ | ||
+ | # iptables -I OUTPUT 1 -s 192.168.1.1/ | ||
+ | </ | ||
+ | |||
+ | Ein erneute Abfrage des '' | ||
+ | < | ||
+ | # iptables -t nat -nvL --line-numbers | ||
+ | Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) | ||
+ | num pkts bytes target | ||
+ | |||
+ | Chain POSTROUTING (policy ACCEPT 980 packets, 82233 bytes) | ||
+ | num pkts bytes target | ||
+ | 1 | ||
+ | 2 82 10989 ACCEPT | ||
+ | 3 | ||
+ | |||
+ | Chain OUTPUT (policy ACCEPT 3598 packets, 294K bytes) | ||
+ | num pkts bytes target | ||
+ | 1 | ||
+ | 2 82 10989 ACCEPT | ||
+ | </ | ||
+ | |||
+ | Die neuen Zeilen sind an **Position 1** und **Postition 2** zu sehen, hier nachfolgend zur Verdeutlichung noch einmal dargestellt (**nur relevanter Ausschnitt**): | ||
+ | < | ||
+ | ... | ||
+ | 1 | ||
+ | 2 82 10989 ACCEPT | ||
+ | ... | ||
+ | 1 | ||
+ | 2 82 10989 ACCEPT | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Um diese '' | ||
+ | < | ||
+ | # service iptables save | ||
+ | iptables: Saving firewall rules to / | ||
+ | </ | ||
tachtler/dns_isc_bind_centos_6_-_master-slave_und_tsig.1344250578.txt.gz · Zuletzt geändert: 2012/08/06 12:56 von klaus