Hi,
I am trying to set up a firewall rule so calls to old_mailserver:25 get redirected to localhost:25. I have seen quite a few rules and none seem to work.
I have tried with the firewall enabled (configured to allow smtp) and disabled, but it doesn't seem to make a difference.
One of the commands I have been using is: /sbin/iptables -t nat -I PREROUTING -p tcp -d old_mailserver_ip/32 --dport 25 -j REDIRECT --to 127.0.0.1:25
Am I missing anything?
Thanks
Gabriel
___________________________________________________________ Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm...
Hi,
Try this:
iptables -t nat -A PREROUTING -p tcp -d old_mailserver_ip --destination-port 25 -j DNAT --to-destination 127.0.0.1:25
first last wrote:
Hi,
I am trying to set up a firewall rule so calls to old_mailserver:25 get redirected to localhost:25. I have seen quite a few rules and none seem to work.
I have tried with the firewall enabled (configured to allow smtp) and disabled, but it doesn't seem to make a difference.
One of the commands I have been using is: /sbin/iptables -t nat -I PREROUTING -p tcp -d old_mailserver_ip/32 --dport 25 -j REDIRECT --to 127.0.0.1:25
Am I missing anything?
Thanks
Gabriel
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm... _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the response but it didn't work. It just hangs there trying to connect and then I get an error "no route to host" (as it should if trying to connect to that host directly.
--- Igor Demjanenko idemjanenko@fotki.com wrote:
Hi,
Try this:
iptables -t nat -A PREROUTING -p tcp -d old_mailserver_ip --destination-port 25 -j DNAT --to-destination 127.0.0.1:25
first last wrote:
Hi,
I am trying to set up a firewall rule so calls to old_mailserver:25
get
redirected to localhost:25. I have seen quite a few rules and none
seem
to work.
I have tried with the firewall enabled (configured to allow smtp)
and
disabled, but it doesn't seem to make a difference.
One of the commands I have been using is: /sbin/iptables -t nat -I PREROUTING -p tcp -d old_mailserver_ip/32 --dport 25 -j REDIRECT --to 127.0.0.1:25
Am I missing anything?
Thanks
Gabriel
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less,
sign up for
your free account today
http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm...
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
___________________________________________________________ Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm...
Igor Demjanenko napsal(a):
Hi,
Try this:
iptables -t nat -A PREROUTING -p tcp -d old_mailserver_ip --destination-port 25 -j DNAT --to-destination 127.0.0.1:25
Try: iptables -t nat -A PREROUTING -p tcp -d old_mailserver_ip --destination-port 25 -j DNAT --to-destination 127.0.0.1
Please do note ":25" missing. David
On Mon, Jun 18, 2007 at 11:46:42AM +0100, first last wrote:
Hi,
I am trying to set up a firewall rule so calls to old_mailserver:25 get redirected to localhost:25. I have seen quite a few rules and none seem to work.
I have tried with the firewall enabled (configured to allow smtp) and disabled, but it doesn't seem to make a difference.
One of the commands I have been using is: /sbin/iptables -t nat -I PREROUTING -p tcp -d old_mailserver_ip/32 --dport 25 -j REDIRECT --to 127.0.0.1:25
Try this: iptables -t nat -I PREROUTING -p tcp -d old_mail_server_ip --dport 25 \ -j REDIRECT iptables -t nat -I OUTPUT -p tcp -d old_mail_server_ip --dport 25 \ -j REDIRECT
Am I missing anything?
Locally generated packets go through OUTPUT, but not PREROUTING, IIRC.
--- Luciano Rocha strange@nsk.no-ip.org wrote:
On Mon, Jun 18, 2007 at 11:46:42AM +0100, first last wrote:
Hi,
I am trying to set up a firewall rule so calls to old_mailserver:25
get
redirected to localhost:25. I have seen quite a few rules and none
seem
to work.
I have tried with the firewall enabled (configured to allow smtp)
and
disabled, but it doesn't seem to make a difference.
One of the commands I have been using is: /sbin/iptables -t nat -I PREROUTING -p tcp -d old_mailserver_ip/32 --dport 25 -j REDIRECT --to 127.0.0.1:25
Try this: iptables -t nat -I PREROUTING -p tcp -d old_mail_server_ip --dport 25 \ -j REDIRECT iptables -t nat -I OUTPUT -p tcp -d old_mail_server_ip --dport 25 \ -j REDIRECT
Thanks, this worked! This just saved me a reboot on the production servers :)
Thanks to all who responded.
Gabriel
___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/