How to use VPN tunnel for all traffic except SMTP (port 25) traffic?
Hi
I'm new to iptable configuration. I've set up a VPN using DD-WRT on my router and it works fine. However the VPN company does not allow port 25 traffic (in case of spammers) so now I can't get my emails sent out.
I'm guessing I can add some rules to my iptable so that all traffic except port 25 traffic can go out through the VPN tunnel. And hopefully, all port 25 traffic will go out through the normal Internet connection.
I've tried:
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT
iptables -I INPUT -i tun0 -j REJECT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
iptables -I INPUT -i eth0 -p tcp --dport 25 -j ACCEPT
iptables -I OUTPUT -o eth0 -p tcp --dport 25 -j ACCEPT
without success.
I'd be grateful if anyone can guide me on the correct set of rules to achieve this.
Many thanks
|