Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


iptables question

Click here to go to the original topic

 
       Linode.com Forum Forum Index -> Linux Networking
Author Message
sednet



Joined: 17 Mar 2004
Posts: 106
Location: Europe

Posted: Fri Mar 21, 2008 5:57 am    Post subject: iptables question  

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.
Back to top  
cz9qvh



Joined: 19 Jan 2008
Posts: 14

Posted: Sun Mar 23, 2008 3:10 pm    Post subject:  

isn't this sort of thing normally done in the nat table as opposed to mangle?
Back to top  
 
       Linode.com Forum Forum Index -> Linux Networking
Page 1 of 1