LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2010, 02:24 PM   #1
maven12
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
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
 
Old 11-08-2010, 03:43 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,176

Rep: Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644
Kind of defeats the point of a vpn to open it up.

You'd need to tunnel to some other place or change ports or don't use the vpn.
 
Old 11-09-2010, 07:00 AM   #3
maven12
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Jefro

I understand the comment but the VPN is actually not there for security, it's simply there to route most of my traffic to a particular outlet onto the Internet. But since the VPN provider blocks SMTP, I need a way to still send my emails.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] redirect traffic to spesific port based on Traffic Content using iptables summersgone Linux - Server 2 06-22-2009 12:26 PM
OpenVPN Tunnel all Traffic trough VPN anon302 Linux - Networking 1 02-25-2009 05:55 PM
Intruder using SMTP to send traffic while port 25 closed flashl Linux - Security 17 09-03-2008 08:38 AM
SNMP MRTG RRDTOOL Configu of CPU memory Disk Port data traffic doc traffic manish_2479 Linux - Networking 1 06-19-2007 08:08 AM
OpenVPN route issues, all traffic through VPN tunnel stuartornum Linux - Server 4 03-05-2007 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration