User Tools

Site Tools


doc:appunti:net:ipv6_on_ppp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:net:ipv6_on_ppp [2026/09/27 07:26] – [Using a static IPv6 address] niccolodoc:appunti:net:ipv6_on_ppp [2026/10/06 10:34] (current) – [Configuring Shorewall6] niccolo
Line 57: Line 57:
 </code> </code>
  
-This is the reason why the IPv6 global (public) address is propbably not eccepted on that interface. To change (temporary) the ''accept_ra'' option for the ppp0 interface you can use the command:+This is the reason why the IPv6 global (public) address is probably not eccepted on that interface. To change (temporary) the ''accept_ra'' option for the ppp0 interface you can use the command:
  
 <code> <code>
Line 109: Line 109:
 /usr/bin/systemctl restart wide-dhcpv6-client.service /usr/bin/systemctl restart wide-dhcpv6-client.service
 </code> </code>
 +
 +===== Manual configuration of the IPv6 prefix delegation =====
 +
 +If your ISP assigns to you a **Prefix Delegation** (an IPv6 subnet), but it does not offer the **DHCPv6 service**, you need to configure the address manually. In our case the WAN IPv6 address is automatically negotiated on the ppp0 interface, so we manually configure the LAN IPv6 address (the delegated prefix) on the internal interface **br0**.
 +
 +Just add the following section into **/etc/netword/interfaces** file:
 +
 +<file>
 +iface br0 inet6 static
 +        address 2a02:2427:513:1c03::1
 +        netmask 64
 +</file>
 +
  
 ===== DHCPv6 client: the wide-dhcpv6-client.service ===== ===== DHCPv6 client: the wide-dhcpv6-client.service =====
Line 490: Line 503:
 </file> </file>
  
-Like for the IPv4, the **CLAMPMSS=Yes** is often required in **/etc/shorewall/shorewall.conf** (see above):+If you want to forward packets from internal interface to the external one (and vice-versa), you need to enable IP forwarding in **/etc/shorewall6/shorewall6.conf**: 
 + 
 +<file> 
 +IP_FORWARDING=On 
 +</file> 
 + 
 +Like for the IPv4, the **CLAMPMSS=Yes** is often required in **/etc/shorewall6/shorewall6.conf** (see above):
  
 <file> <file>
Line 574: Line 593:
  
 # Execute first the default Debian script (DNS, etc.), if it exists. # Execute first the default Debian script (DNS, etc.), if it exists.
-[ -x /etc/wide-dhcpv6/dhcp6c-script ] && /etc/wide-dhcpv6/dhcp6c-script+# We do not need this because the DNS is configured locally, not via DHCPv6. 
 +#[ -x /etc/wide-dhcpv6/dhcp6c-script ] && /etc/wide-dhcpv6/dhcp6c-script
  
 get_src() { get_src() {
Line 592: Line 612:
 done done
  
-[ -n "$SRC" ] || { logger -t dhcp6c-src "nessun indirizzo valido su br0"; exit 0; }+[ -n "$SRC" ] || { logger -t dhcp6c-src "No valid IPv6 address on br0"; exit 0; }
  
 # Replaces (or adds, if it does not already exist) the default route with a metric of 100. # Replaces (or adds, if it does not already exist) the default route with a metric of 100.
 ip -6 route replace default dev ppp0 metric 100 src "$SRC" \ ip -6 route replace default dev ppp0 metric 100 src "$SRC" \
-    && logger -t dhcp6c-src "default route via ppp0 con src $SRC"+    && logger -t dhcp6c-src "Default route via ppp0 with src $SRC"
 exit 0 exit 0
 </code> </code>
  
-===== Commands =====+To hook this script to the moment the IPv6 configuration is received, modify the **/etc/wide-dhcpv6/dhcp6c.conf** configuration file by replacing the default value of //script// in the //interface ppp0// section: 
 + 
 +<file> 
 +interface ppp0 { 
 +    # Send an option for "Identity Association for Prefix Delegation" with ID=0. 
 +    send ia-pd 0; 
 +    # Script executed when the daemon receives a reply message. 
 +    script "/etc/wide-dhcpv6/dhcp6c-src-route"; 
 +}; 
 +</file> 
 + 
 +If you need to call the default Debian hook script **/etc/wide-dhcpv6/dhcp6c-script** (used mainly to set the DNS nameserver on DHCPv6) you need to uncomment the relevant line in the scrtip above. 
 + 
 +You can see all the times that the script is executed (because the DHCPv6 lease renews) using the command: 
 + 
 +<code> 
 +journalctl --boot -t dhcp6c-src 
 +</code> 
 + 
 +===== Useful commands =====
  
 Mostra la **rotta predefinita** per IPv6: Mostra la **rotta predefinita** per IPv6:
Line 625: Line 664:
     inet6 2a02:2420:503:1c03::1/64 scope global      inet6 2a02:2420:503:1c03::1/64 scope global 
        valid_lft forever preferred_lft forever        valid_lft forever preferred_lft forever
 +</code>
 +
 +**Imposta o rimuove manualmente** un indirizzo IPv6 su una interfaccia:
 +
 +<code>
 +ip -6 addr add 2a02:1640:cd04:3::1/64 dev eth1
 +ip -6 addr del 2a02:1640:cd00:41df::1/64 dev eth1
 </code> </code>
  
doc/appunti/net/ipv6_on_ppp.1790486768.txt.gz · Last modified: by niccolo