doc:appunti:net:ipv6
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:net:ipv6 [2012/12/07 10:22] – [Neighbors table] niccolo | doc:appunti:net:ipv6 [2019/08/26 11:06] (current) – [Configurazione automatica] niccolo | ||
|---|---|---|---|
| Line 34: | Line 34: | ||
| ip -6 route add < | ip -6 route add < | ||
| ip -6 route del < | ip -6 route del < | ||
| - | ip -6 route add default via < | + | ip -6 route add default via < |
| - | ip -6 route del default via < | + | ip -6 route del default via < |
| </ | </ | ||
| Line 49: | Line 49: | ||
| Quindi se esiste un host che annuncia la configurazione IPv6 (ad esempio un host GNU/Linux che esegue **radvd**, //Router Advertisement Daemon//), gli host nella stessa LAN si assegnano automaticamente un indirizzo IPv6 valido (ma non il default gateway). | Quindi se esiste un host che annuncia la configurazione IPv6 (ad esempio un host GNU/Linux che esegue **radvd**, //Router Advertisement Daemon//), gli host nella stessa LAN si assegnano automaticamente un indirizzo IPv6 valido (ma non il default gateway). | ||
| + | |||
| + | Per modificare uno di quei parametri creare un file **/ | ||
| + | |||
| + | < | ||
| + | net.ipv6.conf.eth1.accept_ra=0 | ||
| + | </ | ||
| + | |||
| + | Per rendere immediatamente attive le modifiche: | ||
| + | |||
| + | < | ||
| + | cat / | ||
| + | 1 | ||
| + | sysctl --system | ||
| + | cat / | ||
| + | 0 | ||
| + | </ | ||
| ===== Configurazione manuale ===== | ===== Configurazione manuale ===== | ||
| Line 150: | Line 166: | ||
| Cioè: | Cioè: | ||
| - | - Viene mandato una //neighbor solicitation// | + | - Viene mandato una //neighbor solicitation// |
| - | - L'host risponde con il proprio MAC address annunciando il target IPv6 | + | - Il MAC address del destinatario è un multicast 33: |
| + | - L'host risponde con il proprio MAC address annunciando il target IPv6. | ||
| + | |||
| + | Per vedere gli indirizzi multicast registrati su un host: | ||
| + | < | ||
| + | ip maddr show | ||
| + | 1: lo | ||
| + | inet 224.0.0.1 | ||
| + | inet6 ff02::1 | ||
| + | 2: eth0 | ||
| + | link 33: | ||
| + | link 33: | ||
| + | link 01: | ||
| + | link 33: | ||
| + | inet 224.0.0.1 | ||
| + | inet6 ff02:: | ||
| + | inet6 ff02:: | ||
| + | inet6 ff02::1 | ||
| + | </ | ||
| + | |||
| + | Ping per tutti gli host nel link-local scope: | ||
| + | |||
| + | < | ||
| + | ping6 ff02:: | ||
| + | </ | ||
| + | |||
| + | |||
| + | Ping per tutti i router nel link-local scope: | ||
| + | |||
| + | < | ||
| + | ping6 ff02:: | ||
| + | </ | ||
| + | |||
| + | ==== Filtro multicast su switch ==== | ||
| + | |||
| + | Alcuni switch hanno un filtro sui pacchetti multicast abilitato. Questo impedisce il funzionamento del protocollo **[[wp> | ||
| + | |||
| + | Ad esempio sullo switch **3Com 4228G** bisogna disabilitare il **'' | ||
| + | |||
| + | ===== Shorewall6: iptables con IPv6 ===== | ||
| + | |||
| + | Vedere **[[http:// | ||
| + | |||
| + | Un firewall basato su iptables, come Shorewall, non ha alcun effetto sul traffico IPv6. Considerato che con IPv6 l' | ||
| + | |||
| + | Con Debian è sufficiente installare il pacchetto **shorewall6** che affianca il pacchetto **shorewall** e gestisce IPv6 in modo del tutto separato da IPv4. | ||
| + | |||
| + | L' | ||
| + | |||
| + | < | ||
| + | DISABLE_IPV6=No | ||
| + | </ | ||
| + | |||
| + | Copiare dagli esempi (contenuti in **''/ | ||
| + | questi: | ||
| + | |||
| + | **''/ | ||
| + | |||
| + | < | ||
| + | fw firewall | ||
| + | net | ||
| + | </ | ||
| + | |||
| + | **''/ | ||
| + | |||
| + | < | ||
| + | net | ||
| + | </ | ||
| + | |||
| + | **''/ | ||
| + | |||
| + | < | ||
| + | fw all | ||
| + | all | ||
| + | </ | ||
| + | |||
| + | **''/ | ||
| + | |||
| + | < | ||
| + | Ping(ACCEPT) | ||
| + | AllowICMPs | ||
| + | ACCEPT | ||
| + | ACCEPT | ||
| + | ACCEPT | ||
| + | </ | ||
| + | |||
| + | Quindi impostare in **''/ | ||
| + | |||
| + | < | ||
| + | startup=1 | ||
| + | </ | ||
| + | |||
| + | ===== IPv6 su PPP ===== | ||
| + | |||
| + | Alcuni provider forniscono indirizzi IPv6 sulla normale connessione ADSL. In generale funziona l' | ||
| + | |||
| + | === Configurazione manuale === | ||
| + | |||
| + | Se lo stack PPP non è opportunamente configurato, | ||
| + | |||
| + | < | ||
| + | ip -6 addr add 2a02: | ||
| + | ip -6 route add default via fe80:: | ||
| + | </ | ||
| + | |||
| + | === Configurazione automatica === | ||
| + | |||
| + | La configurazione standard di una connessione PPPoE con Debian prevede la creazione di una istanza in **/ | ||
| + | |||
| + | < | ||
| + | auto adsl | ||
| + | iface adsl inet ppp | ||
| + | provider dsl-provider | ||
| + | </ | ||
| + | |||
| + | |||
| + | Nel file **/ | ||
| + | |||
| + | < | ||
| + | +ipv6 | ||
| + | </ | ||
| + | |||
| + | Per ottenere la **configurazione automatica** si sfrutta il protocollo //Stateless Address Autoconfiguration// | ||
| + | |||
| + | Il kernel di Linux espone il parametro **accept_ra** delle varie interfacce di rete tramite lo pseudo filesystem **/ | ||
| + | |||
| + | ^ 0 | Do not accept Router Advertisements. | ||
| + | ^ 1 | Accept Router Advertisements if forwarding is disabled (default). | ||
| + | ^ 2 | Overrule forwarding behaviour. Accept Router Advertisements even if forwarding is enabled. | ||
| + | |||
| + | Il valore predefinito **1** ovviamente **non va bene per un firewall** che effettua il forward dei pacchetti da una LAN verso internet. | ||
| + | |||
| + | Si potrebbe impostare a 2 il valore di default con questo comando: | ||
| + | |||
| + | < | ||
| + | echo 2 > / | ||
| + | </ | ||
| + | |||
| + | In questo modo - quando viene attivata l' | ||
| + | |||
| + | Sembra che la soluzione migliore sia quella di creare un file **/ | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | # Accept Router Advertisements; | ||
| + | echo 2 > "/ | ||
| + | </ | ||
| + | |||
| + | **NOTA**: invece di utilizzare il comando **echo** è possibile, in alternativa, | ||
| + | |||
| + | < | ||
| + | sysctl -w net.ipv6.conf.ppp0.accept_ra=2 | ||
| + | </ | ||
| + | |||
| + | === Riferimenti web === | ||
| + | |||
| + | Vedere questo post: **[[http:// | ||
| + | |||
| + | //By default, a Linux host on an IPv6 network will listen for and | ||
| + | solicit router advertisements in order to choose an IPv6 address | ||
| + | for itself and to set up its default route. This is referred to | ||
| + | as stateless address autoconfiguration (SLAAC).// | ||
| + | |||
| + | //In this context, what makes the difference between router or not | ||
| + | are the settings of the / | ||
| + | files (or the net.ipv6.conf.*.forwarding sysctl). If you turn | ||
| + | your host into a router by setting one of those to “1”, you may | ||
| + | find that your host removes any IPv6 address and default route | ||
| + | it learnt via SLAAC.// | ||
doc/appunti/net/ipv6.1354872162.txt.gz · Last modified: by niccolo
