I actually managed to do this after some trial and error:
The VPS has the public IPs directly attached to its interfaces:
It is better not to use the first IP so that managing the VPS will be easier.
Then, I created a ZeroTier network and joined the VPS and the OPNsense firewall.
Let's use the first subnet: 10.147.17.*
I set the IP:
10.147.17.2 for the VPS
10.147.17.1 for OPNsense
Then, on the VPS, you should have iptables-persistent installed and route all traffic from the public IPs to the IPs from the ZeroTier network. Like so:
sudo iptables -t nat -A PREROUTING -d 18.104.22.168 -j DNAT --to-destination 10.147.17.111
sudo iptables -t nat -A POSTROUTING -s 10.147.17.111 -j SNAT --to-source 22.214.171.124
sudo iptables -t nat -A PREROUTING -d 126.96.36.199 -j DNAT --to-destination 10.147.17.112
sudo iptables -t nat -A POSTROUTING -s 10.147.17.112 -j SNAT --to-source 188.8.131.52
sudo iptables -t nat -A PREROUTING -d 184.108.40.206 -j DNAT --to-destination 10.147.17.113
sudo iptables -t nat -A POSTROUTING -s 10.147.17.113 -j SNAT --to-source 220.127.116.11
sudo iptables -t nat -A PREROUTING -d 18.104.22.168 -j DNAT --to-destination 10.147.17.114
sudo iptables -t nat -A POSTROUTING -s 10.147.17.114 -j SNAT --to-source 22.214.171.124
Next, you should create a bridge in OPNsense between your LAN and your ZeroTier (ZT) interface (at this point, you should already have set up ZeroTier in OPNsense correctly with the IP mentioned above).
The last step is to create a firewall rule in your LAN network to allow traffic from your ZT network to anywhere and from anywhere to your ZT network.
Finally, set the IP in the machine you want the full public IP address for:
Default GW: 10.147.17.2
Thats it. Now you have all the traffic from the VPS to your local machine, almost nothing in between.