I have two interfaces on my linux machine, lets say eth0 and eth1. eth0 is a public IP that has IPv6 address and eth1 has a private IPv4 address. If I try to nat the packets that received on eth1 interface onto IPv6 address, NAT module in the linux kernel needs to take care of converting IPv4 packet to IPv6 packet before sending out. Once a response is received from other end, it will convert the IPv6 packet back to IPv4 before giving to eth1 interface. I want to understand this conversion mechanism. example: You have a mobile with LTE mobile data connection and you want to share internet to others by creating a hotspot in mobile. Now a days, most of LTE providers are giving IPv6 address. Mobiles connected to hotspot will get IPv4 address. But, Mobiles connected hotspot are able to browse internet. All the requests from clients of mobile hotspot are IPv4 packets and the responses received by LTE from internet are IPv6 packets. That means, there is some conversion happening from ipv4 to ipv6 and vice versa in mobile linux stack.
If somebody can point me to linux code or explain the transitions required for this, it would be great. Thanks in advance.