Linode Forum
https://forum.linode.com/

iptables question
https://forum.linode.com/viewtopic.php?f=19&t=3168
Page 1 of 1

Author:  sednet [ Fri Mar 21, 2008 6: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.

Author:  cz9qvh [ Sun Mar 23, 2008 4:10 pm ]
Post subject: 

isn't this sort of thing normally done in the nat table as opposed to mangle?

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/