Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:network:ipv6:ipv6.nat6 [2023/02/16 05:27] – [2. Network] vgaetera | docs:guide-user:network:ipv6:ipv6.nat6 [2023/09/17 23:39] – [Introduction] vgaetera | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| * This how-to describes the method for setting up NAT66 aka NAT6 with IPv6 masquerading on your OpenWrt router. | * This how-to describes the method for setting up NAT66 aka NAT6 with IPv6 masquerading on your OpenWrt router. | ||
| - | * Assuming | + | * Assuming |
| * Avoid using NAT66 and better [[docs: | * Avoid using NAT66 and better [[docs: | ||
| * It is also best to avoid using NAT66 unless you are facing the following problems: | * It is also best to avoid using NAT66 unless you are facing the following problems: | ||
| Line 12: | Line 12: | ||
| * Creating a subnet for when the network doesn' | * Creating a subnet for when the network doesn' | ||
| * Being provided a smaller prefix than a /64 or worse, none at all or a ULA address. | * Being provided a smaller prefix than a /64 or worse, none at all or a ULA address. | ||
| - | * Follow | + | * See also: [[docs: |
| ===== Command-line instructions ===== | ===== Command-line instructions ===== | ||
| Line 26: | Line 26: | ||
| ==== 2. Network ==== | ==== 2. Network ==== | ||
| - | Disable IPv6 source | + | Disable IPv6 source |
| <code bash> | <code bash> | ||
| Line 35: | Line 35: | ||
| </ | </ | ||
| - | Enable | + | Prefer |
| - | ===== Extras | + | ===== Troubleshooting |
| - | ==== DHCPv6 ==== | + | Collect |
| - | Make sure DHCPv6 uses the following settings (on an unmodified OpenWrt installation these should by the default): | + | |
| - | * " | + | |
| - | * " | + | |
| - | * " | + | |
| - | + | ||
| - | You can check this by running | + | |
| <code bash> | <code bash> | ||
| - | # uci show dhcp.lan | + | # Log and status |
| - | ... | + | /etc/init.d/firewall restart |
| - | dhcp.lan.dhcpv6=' | + | |
| - | dhcp.lan.ra=' | + | |
| - | dhcp.lan.ra_management=' | + | |
| - | </code> | + | |
| - | If the output is different, you are not using the defaults and you should set these options to the ones shown above. | + | # Runtime configuration |
| - | If there is an additional line starting with '' | + | ip -6 address show; ip -6 route show table all |
| - | Setups with " | + | ip -6 rule show; nft list ruleset |
| - | However, if " | + | |
| - | Therefore, enabling the " | + | |
| - | ==== ULA prefix ==== | + | # Persistent configuration |
| - | Typically relevant when you do not have a real global prefix assigned by your ISP (in which case your ULA should be a real ULA), AND you want to run local IPv6 (e.g. for NAT66), AND you have applications that preference IPv4 over IPv6 ULA addresses. | + | uci show network; uci show firewall |
| - | + | </code> | |
| - | A trick to get around this is set your [[wp>Unique_local_address|ULA]] prefix to a non-ULA value. | + | |
| - | + | ||
| - | The default ULA prefix represents an address that is not globally routed on the internet by design (only between provider networks). | + | |
| - | + | ||
| - | A lot of clients will prefer IPv4 over a ULA IPv6 address if there is no global IPv6 address assigned, so you may need to change your existing ULA prefix to indicate a global address (i.e. trick it with a non-ULA prefix) to ensure traffic goes over IPv6 by default when possible. | + | |
| - | + | ||
| - | When changing the ULA prefix, it doesn' | + | |
| - | The prefix '' | + | |
| - | The letters '' | + | |
| - | + | ||
| - | Setting '' | + | |
| - | + | ||
| - | Using your ISP assigned prefix as ULA should also work. | + | |
| - | + | ||
| - | However, unless you have a static IPv6 prefix assigned by your ISP, this is not recommended, | + | |
| - | + | ||
| - | But normally if you have a static prefix that you can delegate across your LAN (i.e. real global addresses), then you won't need to change your ULA prefix. | + | |