I am configuring a transparent proxy on my server using the instructions given here https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy
Everything is fine, I make required changes to the torrc file, change nameserver and apply iptables rules then restart network interfaces. Hidden service is accessible up till this point but as soon as I restart the tor service using 'service tor restart', service daemon restarts successfully but the hidden service is no longer accessible.
I try flushing the iptables, restart network interfaces and then again try restarting Tor service daemon but even then the hidden service is not accessible until I reboot the server. After which I am able to access the service. I have confirmed that there is no issue when I restart Tor service daemon after only changing the nameservers, and the issue occurs only after I have applied iptables rules. And for some reason that I don't understand even flushing the iptables and restarting service daemon does not resolve the issue and simply rebooting the server resolves this.
Any idea what could be causing this or is this somehow expected behavior?