Lan IPv4 to wan IPv6

Only IPv6 addresses are obtained in the cellular dial, but only IPv4 addresses are available on the Intranet. How do I enable the Intranet to access the Internet properly

/etc/config/network

config globals 'globals'
        #option ula_prefix 'fd00:1234:5678::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.10.1'
        option netmask '255.255.255.0'
        option mtu '1500'
        #option ip6assign '64'

config interface 'wan1'
        option ifname 'eth0.2'
        option mtu '1500'
        option metric '10'
        option peerdns '1'
        option advance '0'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'cell_wwan0'
        option proto 'dhcpv6'

Can 6to4 tunnels be implemented?

There's a high chance you can provide IPv6 to LAN with RA/PD/relaying, so it is best to check the status of your upstream interface:

ifstatus wan6

As a last resort, you can just uncomment the ula_prefix and ip6assign options to enable NAT66:
https://openwrt.org/docs/guide-user/network/ipv6/ipv6.nat6

Thanks,get v6 address through relay mode and surf the Internet, I have implemented,my test scenario was to access a v6 network through a v4 Intranet.Can map-t implement my application scenario?

Here's the module and related documentation:

A v4 network cannot reach a v6 only site. There is no concept of v6 addresses in v4. A tunneling technique (v6 request, v4 transport, v6 site) could be used, but it doesn't apply to your situation since you have native v6 transport from the ISP.

MAP-T is a 4 to 6 to 4 method (v4 request, v6 transport, v4 site) so I don't think that is what you are asking about either.

1 Like

Yes,last night I already tried MAP-T, which seems to act like a tunnel, requiring two peers

A v6 only ISP almost always provides the outside end of some sort of 6 to 4 proxy / tunnel for their customers. You have to find out what standard they implement. For Telekom and T-Mobile USA, that standard is NAT64.

thanks for the sharing,
屏幕截图 2023-11-15 102855
This seems to achieve this scenario, I am testing

Who is your provider?
Please run on the router and show results:

nslookup ipv4only.arpa.
nslookup ipv4.tlund.se
ping 64:ff9b::c10f:e4c3

This is the result

root@router:/etc# nslookup ipv4only.arpa
Server:         114.114.114.114
Address:        114.114.114.114#53

Name:      ipv4only.arpa
Address 1: 192.0.0.171
Address 2: 192.0.0.170
*** Can't find ipv4only.arpa: No answer
root@router:/etc#
root@router:/etc#
root@router:/etc# nslookup ipv4.tlund.se
Server:         114.114.114.114
Address:        114.114.114.114#53

Name:      ipv4.tlund.se
Address 1: 193.15.228.195
*** Can't find ipv4.tlund.se: No answer
root@router:/etc#
root@router:/etc# ping 64:ff9b::c10f:e4c3
PING 64:ff9b::c10f:e4c3 (64:ff9b::c10f:e4c3): 56 data bytes
^C
--- 64:ff9b::c10f:e4c3 ping statistics ---
10 packets transmitted, 0 packets received, 100% packet loss

No one seems to have used nat46 , is there something wrong with it?

If you have IPv6 only connectivity, why you use IPv4 DNS?
Please re-run the tests with IPv6 DNS assigned by your provider.

The new test

root@router:/etc# nslookup ipv4only.arpa.
Server:         114.114.114.114
Address:        114.114.114.114#53

Name:      ipv4only.arpa
Address 1: 192.0.0.170
Address 2: 192.0.0.171
*** Can't find ipv4only.arpa.: No answer
root@router:/etc# nslookup ipv4.tlund.se
Server:         114.114.114.114
Address:        114.114.114.114#53

Name:      ipv4.tlund.se
Address 1: 193.15.228.195
*** Can't find ipv4.tlund.se: No answer
root@router:/etc#
root@router:/etc#
root@router:/etc# at 1 at+cgpaddr
+CGPADDR: 1,"240E:476:FF93:CDC6::1"
OK
root@router:/etc# ifconfig cell_wwan0
cell_wwan0 Link encap:Ethernet  HWaddr E2:A8:64:70:60:43
          inet6 addr: 240e:476:ff93:cdc6:e0a8:64ff:fe70:6043/64 Scope:Global
          inet6 addr: fe80::e0a8:64ff:fe70:6043/64 Scope:Link
          inet6 addr: 240e:476:ffa6:b630:e0a8:64ff:fe70:6043/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44611 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30501 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40770600 (38.8 MiB)  TX bytes:4331472 (4.1 MiB)

You need to use IPv6 DNS server assigned by your provider.
See if you have it in AT+CGCONTRDP=1 response or in ifstatus {ipv6 interface name} and use it on nslookup command line.

After testing, I found that the corresponding domain name could not be found

root@router:~# at 1 AT+CGCONTRDP=1
+CGCONTRDP: 1,5,"ctlte.mnc011.mcc460.gprs","254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1","","36.14.0.86.64.0.0.0.0.0.0.0.0.0.2.24","36.14.0.86.64.0.128.0.0.0.0.0.0.0.0.105","","",0,0
OK
root@router:~#
root@router:~# nslookup 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1
Server:         114.114.114.114
Address:        114.114.114.114#53

** server can't find 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1: NXDOMAIN
** server can't find 254.128.0.0.0.0.0.0.0.0.0.0.0.0.0.1: NXDOMAIN

I encountered the same problem when I tried to use (ifstatus wan6) dns

Run AT+CGPIAF=1,1,1,0 first to get the proper formatting of IPv6 addresses.
Then run AT+CGCONTRDP=1 again and take one of the two addresses at the end - these are your primary and secondary DNS servers (240e:56:4000::218 and 240e:56:4000:8000::69).
Then add the DNS address to the end of the previously used nslookup command:
nslookup {name} {server address}

The goal of the exercise is to see if Pref64 discovery works that is needed for 464xlat to operate and also to check if provider offers DNS64/NAT64 capability.

I believe the NAT46 module can work, but there is usually no good reason to disable IPv6 on the LAN, so the module has no real use cases.

NAT46 (I assume that means conventional NAT44 before 464xlat aka CLAT) is useful to support IPv4 only applications on the LAN.

In a proper DNS64/NAT64 deployment, a modern browser on a v6 capable LAN device will treat IPv4 websites as v6. They are directly accessible as IPv6 using the "fake" V6 IPs served up by DNS64. NAT46 handles relatively little of the traffic, only edge cases from legacy clients or where a V4 IP is only available (server IP hard coded into the app, or using a private DNS which does not serve DNS64)

Legacy clients after passing through NAT46 have destination V6 addresses exactly the same as the "fake native" V6 IPs from DNS64.

Both have to be backed by a NAT64 aka PLAT on the other side of the v6 only link to the ISP. Any v6 attempt to access a v4 site has to be translated on the Internet side of the ISP and routed into the v4 Internet. As the customer setting up your own router, you need to find out what translation methods are available on your ISP.

The two major tests for this have already been described by others here. The first one is to DNS a site known to be v4 only and see if any AAAA (IPv6 address) record is returned, which means that DNS64 is supported. This as noted must be directed to the ISPs DNS server.

The other test is to attempt to use the "well known" NAT64 prefix 64:ff9b through the IPv6 connection to reach a v4 site on the Internet. The last 32 bits of the test address are the IPv4 of the site, in hex. If the ISP is NAT64 compliant, this prefix will be routed to their NAT64 machine and on to the v4 Internet, and the ping will succeed.

I got this result,does provider offers DNS64/NAT64 capability?

root@router:~# at 1 AT+CGPIAF=1,1,1,0
OK
root@router:~# at 1 at+cgcontrdp=1
+CGCONTRDP: 1,5,"ctlte.mnc011.mcc460.gprs","FE80:0000:0000:0000:0000:0000:0000:0001","","240E:0056:4000:0000:0000:0000:0000:0218","240E:0056:4000:8000:0000:0000:0000:0069","","",0,0
OK
root@router:~#
root@router:~# nslookup ipv4only.arpa. 240E:0056:4000:0000:0000:0000:0000:0218
Server:         240E:0056:4000:0000:0000:0000:0000:0218
Address:        240e:56:4000::218#53

Name:      ipv4only.arpa
Address 1: 192.0.0.170
Address 2: 192.0.0.171
*** Can't find ipv4only.arpa.: No answer
root@router:~#

From the description of nat46, it seems feasible that if the node device does not support v6 codec, nat46 will have real use cases