IPv6 kasutamine Debian Lenniga
Sisukord
Sissejuhatus
Debian Lenny operatsioonisüsteem sisaldab IPv6 protokolli tuge
- tuum - moodul ipv6
- võrguseadistamise utiliidid - ip, ifconfig
- rakendused - tcpdump, Apache veebiserver jt
Võrguseadme seadistamine IPv6 võrku
Aadressi seadistamiseks
# ip -6 addr add 3ffe:ffff:0100:f101::1/64 dev eth0
Aadressi eemaldamiseks
# ip -6 addr del 3ffe:ffff:0100:f101::1/64 dev eth0
radvd
# apt-get install radvd
interface eth0 { AdvSendAdvert on; prefix 3ffe:ffff:0100:f101::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr on; }; };
Tunneli seadistamine
Vaikimisi on Debian Lenny võrguseadmel selline IPv6 seadistus
# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 70:01:68:01:00:53 inet addr:192.168.10.53 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::7201:68ff:fe01:53/64 Scope:Link ..
ja ruutingutabelis sellised sissekanded
# route -n -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If fe80::/64 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo ::1/128 :: Un 0 1 7 lo fe80::7201:68ff:fe01:53/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo
Tunneli moodustamiseks sobib öelda
# ip tunnel add elion mode sit remote 192.168.101.242 local 84.50.96.138 ttl 64 # ip link set elion up # ip addr add 2001:7d0:0:f000::1341/127 dev elion # ip route add default via 2001:7d0:0:f000::1340
Tunneli kasutamiseks ipv4 nat taga töötavast arvutist tuleb local parameetrina kasutada vastava arvuti privaatset ip aadressi, nt 192.168.10.53
Kirjeldatud tunnelite nimekirja näeb öeldes
# ip tunnel show sit0: ipv6/ip remote any local any ttl 64 nopmtudisc elion: ipv6/ip remote 192.168.101.242 local 192.168.10.53 ttl 64
Tunnelile vastav võrguseade on selline
# ifconfig elion Link encap:IPv6-in-IPv4 inet6 addr: fe80::c0a8:a35/128 Scope:Link inet6 addr: 2001:7d0:0:f000::1341/127 Scope:Global UP POINTOPOINT RUNNING NOARP MTU:1480 Metric:1 RX packets:23029 errors:0 dropped:0 overruns:0 frame:0 TX packets:13837 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:33420361 (31.8 MiB) TX bytes:1376474 (1.3 MiB)
Tunneli kustutamiseks sobib öelda
# ip tunnel del elion
Apache veebiserveri kasutamine
IPv6 kasutamisega seotud iseärasused puudutavad ainult võrguseadistusi
- /etc/apache2/ports.conf failis tuleb kasutada sarnast Listen direktiivi
Listen [2001:7d0:0:f000::1341]:80
- /etc/apache2/sites-available/virt.host.conf seadistusfailides tuleb kasutada sellist VirtualHost direktiivi
<VirtualHost [2001:7d0:0:f000::1341]:80>
Võrgu-utiliitide kasutamine
IPv6 protokolli jaoks sobib kasutada kas samu, kui lisavõtmetega või sarnaste nimedega utiliite nagu IPv4 puhul.
ping6
# ping6 -c 2 2001:7d0:0:f000::1341 PING 2001:7d0:0:f000::1341(2001:7d0:0:f000::1341) 56 data bytes 64 bytes from 2001:7d0:0:f000::1341: icmp_seq=1 ttl=64 time=0.015 ms 64 bytes from 2001:7d0:0:f000::1341: icmp_seq=2 ttl=64 time=0.030 ms --- 2001:7d0:0:f000::1341 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.015/0.022/0.030/0.008 ms
netstat
Apache veebiserveriga seotud võrk paistab selliselt
# netstat -anp -A inet6 | grep apache2 tcp6 0 0 2001:7d0:0:f000::134:80 :::* LISTEN 4437/apache2 tcp6 0 0 2001:7d0:0:f000::134:80 2001:bb8:2001:aaf:44524 ESTABLISHED 4444/apache2
route
# route -n -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If 2001:7d0:0:f000::1340/127 :: Un 256 0 8 elion fe80::/64 :: U 256 0 0 eth0 fe80::/64 :: Un 256 0 0 elion ::/0 2001:7d0:0:f000::1340 UG 1024 0 158 elion ::/0 :: !n -1 1 231 lo ::1/128 :: Un 0 1 33 lo 2001:7d0:0:f000::1341/128 :: Un 0 1 23083 lo fe80::c0a8:a35/128 :: Un 0 1 0 lo fe80::7201:68ff:fe01:53/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ff00::/8 :: U 256 0 0 elion ::/0 :: !n -1 1 231 lo
tcpdump
# tcpdump -nei elion ip6 19:01:13.722659 ip: 2001:bb8:2001:aaff::1341.35584 > 2001:7d0:0:f000::1341.80: \ S 3766226387:3766226387(0) win 5680 <mss 1420,sackOK,timestamp 72327337 0,nop,wscale 6> 19:01:13.722774 ip: 2001:7d0:0:f000::1341.80 > 2001:bb8:2001:aaff::1341.35584: \ S 1730547543:1730547543(0) ack 3766226388 win 5632 \ <mss 1420,sackOK,timestamp 5752276 72327337,nop,wscale 6> 19:01:13.741782 ip: 2001:bb8:2001:aaff::1341.35584 > 2001:7d0:0:f000::1341.80: \ . ack 1 win 89 <nop,nop,timestamp 72327347 5752276> ....
ip
IPv6 puhul ARP protokolli ei kasutata, naabrite nimekirja esitamiseks sobib öelda
# ip -6 neigh show fe80::21b:21ff:fe1d:f606 dev eth0 lladdr 00:1b:21:1d:f6:06 REACHABLE fe80::20c:42ff:fe07:1a47 dev eth1 lladdr 00:0c:42:07:1a:47 router DELAY fe80::20e:cff:feb0:96b6 dev eth0 lladdr 00:0e:0c:b0:96:b6 REACHABLE