Whonix Gateway Networking - How does it work?

For socksified connections, you don’t need iptables rules at all.

Tor related. Fortunately Tor can be configured to open a DnsPort and a TransPort listening port. Then you can use iptables to redirect traffic to these ports.

See this short very chapter Anonymizing Middlebox: