With the rise of IPv4 costs, IPv6-only servers are becoming more popular in low end hosting world.
In one occasion, I acquired an IPv6-only server, but wanted to have IPv4 on it.
Somewhere else, I have a dual-stack IPv4+IPv6 server, idling away.
Can I "borrow" the IPv4 of that dual-stack server, to use on the IPv6-only server?
I tried several methods, and found a way to make this work.
Situation / Assumption / Requirement
In this case, both servers have KVM virtualization and are running Debian 12 operating system.
Server A is a dual-stack server, with IPv4 address 192.0.2.158
and IPv6 address 2001:db8:aefc::2
.
Server B is an IPv6-only server, with IPv6 address 2001:db8:eec0::2
.
At server A, both IPv4 and IPv6 service are delivered on the same network interface.
My goal is to somehow "move" the IPv4 address from server A to server B.
In particular, I want all IPv4 traffic to the 192.0.2.158
destination address to reach server B, and allow server B to send any IPv4 traffic with 192.0.2.158
source address.
This shall include all TCP and UDP ports, as well as other IPv4 traffic such as ICMP ping.
A "port forwarding" solution would be insufficient, as it cannot deliver non-TCP/UDP traffic.
Tunnel + Ethernet Bridge (does not work)