Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:network:ipv6_ipv4_transitioning [2021/05/04 04:33] – [6in4 Tunnel / HE.net Tunnel Broker] terminology vgaeteradocs:guide-user:network:ipv6_ipv4_transitioning [2023/01/28 12:12] – [IPv4/IPv6 transition technologies] vgaetera
Line 1: Line 1:
-====== IPv4/IPv6 Transition Technologies ====== +====== IPv4/IPv6 transition technologies ====== 
-Transitioning technologies can be installed using the packages with the same names.\\ +See also: [[docs:guide-user:network:ipv6:nat64|NAT64 for IPv6-only networks]] 
-Setup and management of IPv6-in-IPv4 tunnels: ''6rd''''6to4''''6in4''.\\  + 
-Setup and management of IPv4-in-IPv6 tunnels: ''ds-lite''\\ +Transition technologies can be installed using the following packages: 
 +  IPv6-in-IPv4 tunnels: [[packages:pkgdata:6rd]][[packages:pkgdata:6to4]][[packages:pkgdata:6in4]]
 +  IPv4-in-IPv6 tunnels: [[packages:pkgdata:ds-lite]].
  
 ===== 6in4 Tunnel / HE.net Tunnel Broker ===== ===== 6in4 Tunnel / HE.net Tunnel Broker =====
Line 9: Line 11:
 [[docs:guide-user:network:ipv6:ipv6_henet|IPv6 with Hurricane Electric]] [[docs:guide-user:network:ipv6:ipv6_henet|IPv6 with Hurricane Electric]]
  
-6in4 tunnels are usually provided by external tunnel providers like HE.net. +6in4 tunnels are usually provided by external tunnel providers like HE.net.
  
-:!: The package ''6in4'' must be installed to use this protocol.+:!: The package [[packages:pkgdata:6in4]] must be installed to use this protocol.
  
-:!: 6in4 requires you to have public IPv4-address, clients behind CGNAT are [[https://forums.he.net/index.php?topic=488.0|not supported]].+:!: 6in4 requires you to have public IPv4 address, clients behind CGNAT are [[https://forums.he.net/index.php?topic=488.0|not supported]].
  
 ==== Static IPv6-in-IPv4 Tunnel ==== ==== Static IPv6-in-IPv4 Tunnel ====
Line 23: Line 25:
 config interface 'wan6' config interface 'wan6'
         option proto        '6in4'         option proto        '6in4'
-        option tunlink      'wan' 
         option ipaddr       '178.24.115.19'         option ipaddr       '178.24.115.19'
         option peeraddr     '216.66.80.30'         option peeraddr     '216.66.80.30'
Line 38: Line 39:
 config interface 'wan6' config interface 'wan6'
         option proto     '6in4'         option proto     '6in4'
-        option tunlink   'wan' 
         option mtu       '1424'                      # the IPv6 tunnel MTU (optional)         option mtu       '1424'                      # the IPv6 tunnel MTU (optional)
         option peeraddr  '216.66.80.30'              # the IPv4 tunnel endpoint at the tunnel provider         option peeraddr  '216.66.80.30'              # the IPv4 tunnel endpoint at the tunnel provider
Line 57: Line 57:
 === Firewall === === Firewall ===
 Some users may require to add extra firewall rules to allow 6in4 traffic to always reach their tunnel endpoint. Some users may require to add extra firewall rules to allow 6in4 traffic to always reach their tunnel endpoint.
-Package [[packages:pkgdata:iptables-mod-ipopt]] must be installed for length matching.+The package [[packages:pkgdata:iptables-mod-ipopt]] must be installed for length matching.
  
 <code bash> <code bash>
Line 91: Line 91:
 | ''ip6addr'' | IPv6 address (CIDR) | yes | //(none)// | Local IPv6 address delegated to the tunnel endpoint | | ''ip6addr'' | IPv6 address (CIDR) | yes | //(none)// | Local IPv6 address delegated to the tunnel endpoint |
 | ''ip6prefix'' | IPv6 prefix | no | //(none)// | Routed IPv6 prefix for downstream interfaces (Barrier Breaker and later only) | | ''ip6prefix'' | IPv6 prefix | no | //(none)// | Routed IPv6 prefix for downstream interfaces (Barrier Breaker and later only) |
-| ''tunlink'' | Logical Interface | no | //(none)// | Tunnel base interface |+| ''tunlink'' | Logical Interface | no | //(none)// | Tunnel base interface. Define which Interface, for example WAN, should be used for outgoing IPv4 traffic to the Remote IPv4 Address |
 | ''defaultroute'' | boolean | no | ''1'' | Whether to create an IPv6 default route over the tunnel | | ''defaultroute'' | boolean | no | ''1'' | Whether to create an IPv6 default route over the tunnel |
 | ''ttl'' | integer | no | ''64'' | TTL used for the tunnel interface | | ''ttl'' | integer | no | ''64'' | TTL used for the tunnel interface |
-| ''tos'' | string | no | //(none)// | Type Of Service : either "inherit" (the outer header inherits the value of the inner header) or an hexadecimal value. Also known as DSCP. (Chaos Calmer and later only) |+| ''tos'' | string | no | //(none)// | Type Of Service : either "inherit" (the outer header inherits the value of the inner header) or an hexadecimal value. Also known as DSCP. |
 | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface | | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface |
 | ''tunnelid'' | integer | no | //(none)// | HE.net global tunnel ID, used for endpoint update | | ''tunnelid'' | integer | no | //(none)// | HE.net global tunnel ID, used for endpoint update |
Line 102: Line 102:
 | ''metric'' | integer | no | ''0'' | Specifies the default route metric to use | | ''metric'' | integer | no | ''0'' | Specifies the default route metric to use |
  
-:!: This protocol type does not need an ''ifname'' option set in the interface section. The interface name is derived from the section name, e.g. ''config interface sixbone'' would result in an interface named ''6in4-sixbone''+:!: This protocol type does not need the ''device'' option set in the interface section. 
- +The interface name is derived from the section name, e.g. ''config interface sixbone'' would result in an interface named ''6in4-sixbone''.
-:!: One of the ustream SSL Library variants (package ''libustream-*'') should be installed for HE.net endpoint update to be performed over **https**. (optional for https: install packages ''ca-certificates'' and ''ca-bundle'' for server certificate validation.) Otherwise endpoint update will be performed over **http**.+
  
 :!: Although ''ip6prefix'' isn't required, ''sourcefilter'' is enabled by default and prevents forwarding of packets unless ''ip6prefix'' is specified. :!: Although ''ip6prefix'' isn't required, ''sourcefilter'' is enabled by default and prevents forwarding of packets unless ''ip6prefix'' is specified.
  
 ===== 6rd Tunnel (ISP-Provided IPv6 Transition) ===== ===== 6rd Tunnel (ISP-Provided IPv6 Transition) =====
-6rd is a tunnel mechanism based on 6to4. Unlike other tunneling mechanisms, 6rd is usually provided by the ISP itself. +6rd is a tunnel mechanism based on 6to4. 
 +Unlike other tunneling mechanisms, 6rd is usually provided by the ISP itself.
  
-:!: The package ''6rd'' must be installed to use this protocol.+:!: The package [[packages:pkgdata:6rd]] must be installed to use this protocol.
  
 :!: The configuration of 6rd is usually auto-detected and manual configuration is not needed, simply installing the 6rd package (and rebooting) is usually enough. :!: The configuration of 6rd is usually auto-detected and manual configuration is not needed, simply installing the 6rd package (and rebooting) is usually enough.
  
-:!: To automatically configure 6rd from dhcp you need to create an interface with ''option auto 0'' and put its name as the 'iface6rd' parameter. In addition you also need to add its name to a suitable firewall zone in /etc/config/firewall.+:!: To automatically configure 6rd from dhcp you need to create an interface with ''option auto 0'' and put its name as the 'iface6rd' parameter. 
 +In addition you also need to add its name to a suitable firewall zone in ''/etc/config/firewall''.
  
 <code bash> <code bash>
Line 127: Line 128:
 </code> </code>
  
-To debug 6rd via DHCP, first check if the parameters are sent. Create a ''/etc/udhcpc.user'' file with the following content:+To debug 6rd via DHCP, first check if the parameters are sent. 
 +Create a ''/etc/udhcpc.user'' file with the following content:
  
 <code bash> <code bash>
Line 140: Line 142:
 </code> </code>
  
-If this line isn't present, you need to obtain the correct values for peeraddr, ip6prefix, ip6prefixlen and ip4prefixlen from your ISP. The above ip6rd or the obtained values can be used to hardcode the 6RD tunnel. Remove or comment out the iface6rd line in the wan section.+If this line isn't present, you need to obtain the correct values for peeraddr, ip6prefix, ip6prefixlen and ip4prefixlen from your ISP. 
 +The above ip6rd or the obtained values can be used to hardcode the 6rd tunnel. 
 +Remove or comment out the iface6rd line in the wan section.
  
-:!: If you choose a name for your tunnel-interface that is different from 'wan6' make sure to add that name to the network-option of the firewall-zone 'wan' in /etc/config/firewall.+:!: If you choose a name for your tunnel-interface different from ''wan6'', be sure to add that network to the ''wan'firewall-zone.
  
 Below configuration options are only needed for hardcoding the 6rd tunnel. Below configuration options are only needed for hardcoding the 6rd tunnel.
Line 148: Line 152:
 ===== Protocol 6rd ===== ===== Protocol 6rd =====
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''peeraddr'' | IPv4 address | yes | no | 6rd - Gateway  |+| ''peeraddr'' | IPv4 address | yes | no | 6rd - Gateway |
 | ''ipaddr'' | IPv4 address | no | Current WAN IPv4 address | Local IPv4 endpoint address | | ''ipaddr'' | IPv4 address | no | Current WAN IPv4 address | Local IPv4 endpoint address |
 | ''ip6prefix'' | IPv6 prefix (without length) | yes | no | 6rd-IPv6 Prefix | | ''ip6prefix'' | IPv6 prefix (without length) | yes | no | 6rd-IPv6 Prefix |
Line 155: Line 159:
 | ''defaultroute'' | boolean | no | ''1'' | Whether to create an IPv6 default route over the tunnel | | ''defaultroute'' | boolean | no | ''1'' | Whether to create an IPv6 default route over the tunnel |
 | ''ttl'' | integer | no | ''64'' | TTL used for the tunnel interface | | ''ttl'' | integer | no | ''64'' | TTL used for the tunnel interface |
-| ''tos'' | string | no | //(none)// | Type Of Service : either "inherit" (the outer header inherits the value of the inner header) or an hexadecimal value (Chaos Calmer and later only) |+| ''tos'' | string | no | //(none)// | Type Of Service: either "inherit" (the outer header inherits the value of the inner header) or an hexadecimal value |
 | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface | | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface |
 | ''iface6rd'' | logical interface | no | //(none)// | Logical interface template for auto-configuration of 6rd | | ''iface6rd'' | logical interface | no | //(none)// | Logical interface template for auto-configuration of 6rd |
Line 161: Line 165:
 | ''zone6rd'' | firewall zone | no | //system default// | Firewall zone to which the 6rd interface should be added | | ''zone6rd'' | firewall zone | no | //system default// | Firewall zone to which the 6rd interface should be added |
  
-:!: This protocol type does not need an ''ifname'' option set in the interface section. The interface name is derived from the section name, e.g. ''config interface wan6'' would result in an interface named ''6rd-wan6''.+:!: This protocol type does not need the ''device'' option set in the interface section. 
 +The interface name is derived from the section name, e.g. ''config interface wan6'' would result in an interface named ''6rd-wan6''.
  
-:!: Some ISP's give you the number of bytes you should use from your WAN IP to calculate your IPv6 address. ip4prefixlen expects the //prefix// bytes of your WAN IP to calculate the IPv6 address. So if your ISP gives you 14 bytes to calculate, enter 18 (32 - 14).+:!: Some ISP's give you the number of bytes you should use from your WAN IP to calculate your IPv6 address. 
 +''ip4prefixlen'' expects the //prefix// bytes of your WAN IP to calculate the IPv6 address. 
 +So if your ISP gives you 14 bytes to calculate, enter 18 (32 - 14).
  
 ===== 6pe, L2TP Tunnel (ISP-provided IPv6 Transition) ===== ===== 6pe, L2TP Tunnel (ISP-provided IPv6 Transition) =====
-This is another transitional mechanism for IPv6 used by some ISPs,  it relies on a L2TPv2 tunnel.+This is another transitional mechanism for IPv6 used by some ISPs, it relies on a L2TPv2 tunnel.
  
-:!: The package ''xl2tpd'' must be installed to use this protocol. It will handle the L2TP tunnel and PPP session.+:!: The package [[packages:pkgdata:xl2tpd]] must be installed to use this protocol. 
 +It will handle the L2TP tunnel and PPP session.
  
 The high-level description of the tunneling is the following: The high-level description of the tunneling is the following:
 +  - An L2TP tunnel is created, encapsulated in UDP packets over IPv4.
 +  - A PPP session is established inside the tunnel.
 +  - IPv6CP (see [[http://tools.ietf.org/html/rfc5072|RFC 5072]]) is used to negotiate link-local IPv6 addresses.
 +  - An IPv6 prefix is obtained thanks to DHCPv6.
  
-  - a L2TP tunnel is created, encapsulated in UDP packets over IPv4 +This howto is derived from an experience with SFR, in France (FTTH residential access). 
-  - a PPP session is established inside the tunnel +It might apply to other ISPs as well. 
-  - IPv6CP (see [[http://tools.ietf.org/html/rfc5072|RFC 5072]]) is used to negotiate link-local IPv6 addresses  +In the case of SFR, steps 1 and 2 require an authentication. 
-  - an IPv6 prefix is obtained thanks to DHCPv6 +Fortunately, the L2TP password is hardcoded. 
- +The PPP password is not, but it's sent as cleartext, so a simple sniffing is enough to recover it.
-This howto is derived from an experience with SFR, in France (FTTH residential access). It might apply to other ISPs as well.\\  +
-In the case of SFR, steps 1 and 2 require an authentication. Fortunately, the L2TP password is hardcoded. The PPP password is not, but it's sent as cleartext, so a simple sniffing is enough to recover it.+
  
 <code bash> <code bash>
Line 191: Line 201:
  
 config interface 'wan6' config interface 'wan6'
-        option ifname '@6pe'+        option device '@6pe'
         option proto 'dhcpv6'         option proto 'dhcpv6'
 </code> </code>
Line 202: Line 212:
 </code> </code>
  
-At this point, running ''/etc/init.d/network reload'' or simply running ''ifup wan6'' should give you a fully working IPv6 setup.\\ +At this point, running ''/etc/init.d/network reload'' or simply running ''ifup wan6'' should give you a fully working IPv6 setup.
 To debug, look at the logs (''logread'') and the interfaces status (''ifstatus 6pe'' and ''ifstatus wan6''). To debug, look at the logs (''logread'') and the interfaces status (''ifstatus 6pe'' and ''ifstatus wan6'').
  
Line 211: Line 221:
  
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''server'' | string | yes | //(none)// | L2TP server to connect to.  Acceptable datatypes are hostname or IP address, with optional port separated by colon '':'' Note that specifying port is only supported recently and should appear in DD release |+| ''server'' | string | yes | //(none)// | L2TP server to connect to. Acceptable datatypes are hostname or IP address, with optional port separated by colon '':''. Note that specifying port is only supported recently and should appear in DD release |
 | ''username'' | string | no | //(none)// | Username for PAP/CHAP authentication | | ''username'' | string | no | //(none)// | Username for PAP/CHAP authentication |
 | ''password'' | string | yes if ''username'' is provided | //(none)// | Password for PAP/CHAP authentication | | ''password'' | string | yes if ''username'' is provided | //(none)// | Password for PAP/CHAP authentication |
Line 217: Line 227:
 | ''mtu'' | int | no | ''pppd'' default | Maximum Transmit/Receive Unit, in bytes | | ''mtu'' | int | no | ''pppd'' default | Maximum Transmit/Receive Unit, in bytes |
 | ''keepalive'' | string | no | //(none)// | Number of unanswered echo requests before considering the peer dead. The interval between echo requests is 5 seconds. | | ''keepalive'' | string | no | //(none)// | Number of unanswered echo requests before considering the peer dead. The interval between echo requests is 5 seconds. |
-| ''checkup_interval'' | int | no | //(none)// | Number of seconds to pass before checking if the interface is not up since the last setup attempt and retry the connection otherwise.  Set it to a value sufficient for a successful L2TP connection for you.  It's mainly for the case that netifd sent the connect request yet xl2tpd failed to complete it without the notice of netifd |+| ''checkup_interval'' | int | no | //(none)// | Number of seconds to pass before checking if the interface is not up since the last setup attempt and retry the connection otherwise. Set it to a value sufficient for a successful L2TP connection for you. It's mainly for the case that netifd sent the connect request yet xl2tpd failed to complete it without the notice of netifd |
 | ''pppd_options'' | string | no | //(none)// | Additional options to pass to ''pppd'' | | ''pppd_options'' | string | no | //(none)// | Additional options to pass to ''pppd'' |
  
Line 225: Line 235:
 6to4 is the simplest IPv6 tunneling mechanism and relies on publicly available gateways. 6to4 is the simplest IPv6 tunneling mechanism and relies on publicly available gateways.
  
-:!: The package ''6to4'' must be installed to use this protocol.+:!: The package [[packages:pkgdata:6to4]] must be installed to use this protocol.
  
 <code bash> <code bash>
Line 231: Line 241:
 config interface 'wan6' config interface 'wan6'
         option proto '6to4'         option proto '6to4'
 +
 +# /etc/config/firewall
 +config rule
 +        option target 'ACCEPT' 
 +        option name '6to4' 
 +        option src 'wan' 
 +        option proto '41'
 </code> </code>
  
-:!: If you choose a name for your tunnel-interface that is different from 'wan6' make sure to add that name to the network-option of the firewall-zone 'wan' in /etc/config/firewall.+:!: If you choose a name for your tunnel-interface different from ''wan6'', be sure to add that network to the ''wan'firewall-zone.
  
 See below for advanced configuration options. See below for advanced configuration options.
Line 245: Line 262:
 | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface | | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface |
 | ''metric'' | integer | no | ''0'' | Specifies the default route metric to use | | ''metric'' | integer | no | ''0'' | Specifies the default route metric to use |
-| <del>''adv_interface''</del> | <del>string</del> | <del>no</del> | <del>''lan''</del> | **deprecated** <del>The //logical interface name// of the network the subnet should be advertised on. Multiple interface names can be given.</del> | 
-| <del>''adv_subnet''</del> | <del>hex number</del> | <del>no</del> | <del>''1''</del> | **deprecated** <del>A subnet ID between ''1'' and ''FFFF'' which selects the advertised /64 prefix from the mapped 6to4 space. The subnet ID is incremented by 1 for every interface specified in ''adv_interface''.</del>  | 
-| <del>''adv_valid_lifetime''</del> |<del> integer</del> | <del>no</del> | <del>''300''</del> | **deprecated** <del>Overrides the advertised valid prefix lifetime, in seconds (used with radvd)</del> | 
-| <del>''adv_preferred_lifetime''</del> | <del>integer</del> | <del>no</del> | <del>''120''</del> | **deprecated** <del>Overrides the advertised preferred prefix lifetime, in seconds (used with radvd)</del> | 
- 
-:!: This protocol type does not need an ''ifname'' option set in the interface section. The interface name is derived from the section name, e.g. ''config interface wan6'' would result in an interface named ''6to4-wan6''. \\ 
  
-:!: <del>If radvd is installed and enabled, the 6to4 scripts will add a temporary prefix and interface declaration to the //radvd// uci configuration and perform a daemon restart if required</del> (**deprecated**)+:!: This protocol type does not need the ''device'' option set in the interface section. 
 +The interface name is derived from the section name, e.g. ''config interface wan6'' would result in an interface named ''6to4-wan6''.
  
 ===== Dual-Stack Lite tunnel (ds-lite IPv4 in IPv6) ===== ===== Dual-Stack Lite tunnel (ds-lite IPv4 in IPv6) =====
 ds-lite is a transitioning-mechanism which is used by ISPs to support legacy IPv4-connectivity over a native IPv6 connection. ds-lite is a transitioning-mechanism which is used by ISPs to support legacy IPv4-connectivity over a native IPv6 connection.
  
-:!: The package ''ds-lite'' must be installed to use this protocol.+:!: The package [[packages:pkgdata:ds-lite]] must be installed to use this protocol.
  
 :!: The configuration is usually auto-detected and manual configuration is not needed, simply installing the ds-lite package (and restarting the network interfaces like when changing the configuration) is usually enough. :!: The configuration is usually auto-detected and manual configuration is not needed, simply installing the ds-lite package (and restarting the network interfaces like when changing the configuration) is usually enough.
Line 264: Line 276:
 # /etc/config/network # /etc/config/network
 config interface 'wan6' config interface 'wan6'
-        option ifname 'eth1'+        option device 'eth1'
         option proto 'dhcpv6'         option proto 'dhcpv6'
  
Line 272: Line 284:
 </code> </code>
  
-:!: If you choose a name for your tunnel-interface that is different from 'wan' make sure to add that name to the network-option of the firewall-zone 'wan' in /etc/config/firewall.+:!: If you choose a name for your tunnel-interface different from ''wan'', be sure to add that network to the ''wan'firewall-zone.
  
 See below for advanced configuration options. See below for advanced configuration options.
Line 278: Line 290:
 ===== Protocol dslite (Dual-Stack Lite) ===== ===== Protocol dslite (Dual-Stack Lite) =====
 ^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''peeraddr'' | IPv6 address | yes | no | DS-Lite AFTR address  |+| ''peeraddr'' | IPv6 address | yes | no | DS-Lite AFTR address |
 | ''ip6addr'' | IPv6 address | no | Current WAN IPv6 address | Local IPv6 endpoint address | | ''ip6addr'' | IPv6 address | no | Current WAN IPv6 address | Local IPv6 endpoint address |
 | ''tunlink'' | Logical Interface | no | Current WAN interface | Tunnel base interface | | ''tunlink'' | Logical Interface | no | Current WAN interface | Tunnel base interface |
Line 285: Line 297:
 | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface | | ''mtu'' | integer | no | ''1280'' | MTU used for the tunnel interface |
  
-:!: ds-lite operation requires that IPv4 NAT is disabled. You should adjust your settings in /etc/config/firewall accordingly.+:!: ds-lite operation requires that IPv4 NAT is disabled. 
 +You should adjust your settings in /etc/config/firewall accordingly.
  
-:!: This protocol type does not need an ''ifname'' option set in the interface section. The interface name is derived from the section name, e.g. ''config interface wan'' would result in an interface named ''dslite-wan''.+:!: This protocol type does not need the ''device'' option set in the interface section. 
 +The interface name is derived from the section name, e.g. ''config interface wan'' would result in an interface named ''dslite-wan''.
  
  • Last modified: 2023/10/14 06:51
  • by vgaetera