Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: iptables question
PostPosted: Fri Mar 21, 2008 6:57 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 4:11 pm
Posts: 554
Website: http://www.unixtastic.com
Location: Europe
I have a linux gateway. I would like to route everything to one firewall except mail which I'll like to route to another firewall. How do you redirect by destination port in iptables?

The man page mentioned a concept of 'redirect' but it doesn't sound useful.

EDIT What I was looking for:

iptables -t mangle -A PREROUTING -p tcp --dport 25 -j MARK --set-mark 1
ip rule add fwmark 1 table 10
ip route add table 10 <IP of alternate gateway> dev <network interface>

That seems quite useful if you have two or more lines with different SLA's and you want to route accordingly.


Top
   
 Post subject:
PostPosted: Sun Mar 23, 2008 4:10 pm 
Offline
Senior Newbie

Joined: Sat Jan 19, 2008 8:37 pm
Posts: 19
isn't this sort of thing normally done in the nat table as opposed to mangle?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group