toreanderson / clatd

A 464XLAT CLAT implementation for Linux
MIT License
213 stars 19 forks source link

How can I make each device in the clat subnet have its own virtual v6 address #37

Closed SZ-RD-HHF closed 1 year ago

SZ-RD-HHF commented 1 year ago

The packet source IP from clat 192.0.0.1 will be translated as clat-v6 addr. The destination IP will be translated as plat prefix+dst IP. TCPDump has checked and is correct. But if the subnet has many devices, such as 192.168.0.3, 192.168.0.6192.168.0.10,how to make them access external websites correctly and independently

toreanderson commented 1 year ago

Which subnet are you referring to? Are you using clatd on a router with a LAN segment behind it? If so I believe you can just treat the clat interface as an IPv4 WAN interface, and use SNAT/MASQUERADE in iptables/nftables so that source IPs on the LAN segment is re-written to 192.0.0.1 before translation to IPv6.

SZ-RD-HHF commented 1 year ago

Thank you very much, I understand it