Migration auf IPv6: Difference between revisions

From
Jump to navigation Jump to search
Line 174: Line 174:
</pre>
</pre>


==named.conf==
==/etc/bind/named.conf==
<pre>
<pre>



Revision as of 09:44, 26 September 2011

like pastebin ;)

Leserlich wirds später

Aufgabe

Ein Netzwerk einrichten welches aus 2 Routern besteht. Diese trennen 2 Subnetze mit jeweils zwei IPv4 PCs und 2 IPv6 PCs. Jetzt wird einer der IPv4 PCs auf IPv6 migriert und das Netzwerk soll problemlos weiter funktionieren.

Unser Netzwerkaufbau

Netzwerk einrichten

Zu Beginn haben wir auf allen Systemen Debian 6 installiert und diese wie auf obiger Grafik zu sehen ist, verkabelt. Dann mussten die richtigen Interfaces bei den Routern und Subnetrechnern an- bzw. ausgeschaltet werden. Ein ganzes Interface ausschalten ist mit: "ifconfig <Interfacename> down" möglich. Z.B.: "ifconfig eth1 down" schaltet das ganze Interface eth1 ab. Ein Interface wieder einschalten geht analog mit: "ifconfig <Interfacename> up".

Unsere Subnetrechner sind alle über eth0 an das Netzwerk angeschlossen. Die eth1 Schnittstellen der Subnetrechner sind aktuell nicht weiter verwendet. Die Router sind über eth0 an ihr lokales Subnetz angebunden und haben eine direkte Verbindung zum zweiten Router über eth1. Die eth2 Schnittstellen der Router sind aktuell nicht weiter verwendet.

IP-Adressen manuell vergeben

Danach vergeben wird die benötigten 4er IP-Adressen.

  • für IPv4: ifconfig <Interfacename> add <Adresse>

z.B.: ifconfig eth0 add 192.168.1.10

  • für IPv6: ifconfig <Interfacename> inet6 add <Adresse>

z.B.: ifconfig eth0 inet6 add fc00::0:1:2c0:6cff:fe00:f012

Jedes Gerät hat zwar automatisch eine IPv6 Adresse (link-local). Diese ist jedoch nur innerhalb des Subnetzwerkes erreichbar und somit per Definition nicht von außen verfügbar. Man kann manuell eine IPv6 Adresse (global) vergeben. Diese wird dann auch von den Routern geroutet.

Um IP Adressen fest zu vergeben werden diese in der Datei /etc/network/interfaces eingetragen.

Ein Beispiel: Karow: /etc/network/interfaces

Nameserver

Da jetzt die Rechner erreichbar sind, aber die Adressen eher unhandlich erscheinen, vergeben wir Namen und lassen diese durch einen Nameserver auflösen. Durch einen Eintrag in /etc/resolv.conf wird der Nameserver anhand seiner IP bekannt gemacht. Der Nameserver ist bind in Version 9.

Da jedes Subnetz einen Nameserver benötigt fungiert R1 sowie R2 als DNS. Um nicht selbst die Einstellungen von R1 auf R2 kopieren zu müssen hat R1 die Funktion eines Master-nameservers und R2 die eines Slave-nameservers. Ändert sich jetzt eine relevante Datei auf R1 wird eine Benachrichtigung (engl. notify) an R2 gesendet. Daraufhin kann dieser die benötigten neuen Dateien kopieren und in einem temporären Verzeichnis abspeichern. Die Aktualität der Files wird anhand einer Seriennummer entschieden. (s.u.)

Configfiles für den Nameserver

/etc/bind/

.local
.options
Zonefiles (Name -> IP): chaos.local
Reverselookup (IP -> Name): 1. & 2. (v4)
0. & 0. (v6)

/etc/sysctl.conf uncommenting the line for net.ipv6.conf.all.forwarding

6in4 Tunnel

Da die beiden Router über IPv4 kommunizieren war es notwendig die IPv6 Pakete in IPv4 Pakete zu verpacken und nach dem Senden...

Dazu Tunnelinterface erzeugen (virtual device): Neuer Eintrag in der Datei /etc/network/interfaces mit dem Inhalt: auto sit1 iface sit0 inet6 static adress <6er Adresse> ... TODO !!!!!!!!

Quelldateien

/etc/network/interfaces

Karow


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
	address 192.168.1.1
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 127.0.0.1
	dns-search chaos.local

iface eth0 inet6 static
	address fc00::1:2c0:6cff:fe00:f001
	netmask 64
	#gateway fc00::1:1:2c0:6cff:fe00:f001
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers ::1
	dns-search chaos.local

auto 6in4
iface 6in4 inet6 v4tunnel
        address fc00::1:1:2c0:6cff:fe00:f001
        netmask 64
        endpoint 172.16.1.2
        local 172.16.1.1
        ttl 255
        gateway fc00::1:1:2c0:6cff:fe00:f002

allow-hotplug eth1
iface eth1 inet static
	address 172.16.1.1
	netmask 255.255.0.0
	network 172.16.0.0
	broadcast 172.16.255.255
	gateway 172.16.1.2
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 127.0.0.1
	dns-search chaos.local
	up ip -6 addr flush dev $IFACE || true

<pre>

===Lankwitz===
===Britz (IPv6)===
===Buckow (IPv4)===

==/etc/bind/chaos.local==
===Karow===
<pre>

Lankwitz

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
	address 192.168.2.1
	netmask 255.255.255.0
	network 192.168.2.0
	broadcast 192.168.2.255
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 127.0.0.1
	dns-search chaos.local

iface eth0 inet6 static
        address fc00::2:1:2c0:6cff:fe00:f001
        netmask 64
        #gateway fc00::1:1:2c0:6cff:fe00:f002
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers ::1
        dns-search chaos.local

auto 6in4
iface 6in4 inet6 v4tunnel
        address fc00::1:1:2c0:6cff:fe00:f002
        netmask 64
	endpoint 172.16.1.1
	local 172.16.1.2
	ttl 255
        gateway fc00::1:1:2c0:6cff:fe00:f001

allow-hotplug eth1
iface eth1 inet static
	address 172.16.1.2
	netmask 255.255.0.0
	network 172.16.0.0
	broadcast 172.16.255.255
	gateway 172.16.1.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 127.0.0.1
	dns-search chaos.local
	up ip -6 addr flush dev $IFACE || true

/etc/bind/named.conf


include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

/etc/bind/named.conf.local

Karow

zone "chaos.local" {
	type master;
	file "/etc/bind/chaos.local";
	allow-transfer {
		172.16.1.2;
	};
};
zone "1.168.192.in-addr.arpa" {
	type master;
	file "/etc/bind/1.168.192.in-addr.arpa";
	allow-transfer {
		172.16.1.2;
	};
};
zone "2.168.192.in-addr.arpa" {
	type master;
	file "/etc/bind/2.168.192.in-addr.arpa";
	allow-transfer {
		172.16.1.2;
	};
};
zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type master;
	file "/etc/bind/0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa";
	allow-transfer {
		172.16.1.2;
	};
};
zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.2.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type master;
	file "/etc/bind/0.f.1.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.2.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa";
	allow-transfer {
		172.16.1.2;
	};
};
zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.1.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type master;
	file "/etc/bind/0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.1.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa";
	allow-transfer {
		172.16.1.2;
	};
};

Lankwitz

zone "chaos.local" {
	type slave;
	file "chaos.local.bak";
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};

zone "1.168.192.in-addr.arpa" {
	type slave;
	file "1.168.192.in-addr.arpa.bak"; 
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};

zone "2.168.192.in-addr.arpa" {
	type slave;
	file "2.168.192.in-addr.arpa.bak";
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};

zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type slave;
	file "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa.bak";
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};
zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.2.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type slave;
	file "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.2.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa.bak";
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};
zone "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.1.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa" {
	type slave;
	file "0.f.0.0.e.f.f.f.c.6.0.c.2.0.1.0.0.0.1.0.0.0.0.0.0.0.0.0.c.f.ip6.arpa.bak";
	masters {
		172.16.1.1;
	};
	allow-notify {
		172.16.1.1;
	};
};

/etc/bind/1.168.192.in-addr.arpa

1.168.192.in-addr.arpa. 	IN SOA	karow.chaos.local. root.chaos.local. (
		2011092204	; serial
		1D		; refresh
		2H		; retry
		1W		; expiry
		2D )		; minimum

		IN NS 	karow.chaos.local.
		IN NS	lankwitz.chaos.local.
1		IN PTR	karow.chaos.local.
10		IN PTR	marzahn.chaos.local.	
11		IN PTR	buckow.chaos.local.

/etc/bind/2.168.192.in-addr.arpa

Karow

2.168.192.in-addr.arpa. 	IN SOA	karow.chaos.local. root.chaos.local. (
		2011092204	; serial
		1D		; refresh
		2H		; retry
		1W		; expiry
		2D )		; minimum

		IN NS 	karow.chaos.local.
		IN NS	lankwitz.chaos.local.
1		IN PTR	lankwitz.chaos.local.
10		IN PTR	alex.chaos.local.
11		IN PTR	mitte.chaos.local.
13		IN PTR	kudamm.chaos.local.