Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-28-2012, 03:15 PM   #1
LQ Newbie
Registered: Nov 2011
Posts: 10

Rep: Reputation: Disabled
Cannot redirect traffic to new IP with iptables on centOS

Hi, today I able to migrate some of the game servers to another server and needed some help to redirect the traffic from old ip to the new one.

SERVER1 ----- (internet ) -----> SERVER

I asume to use iptables to perform this, for that used this rule on my centOS box in the server1.

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -d \
-p udp --dport 27015 -j SNAT --to

But the client cannot connect to the server from the old ip, the redirection don't started.

Last edited by farenheitcx; 08-28-2012 at 03:16 PM.
Old 08-30-2012, 01:12 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You need to use PREROUTING to redirect incoming traffic.

Here is a tutorial for doing the same thing:

Last edited by jschiwal; 08-30-2012 at 01:19 AM.
2 members found this post helpful.



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
Can i use iptables to redirect all outbound ethernet traffic to an........ fruittool Linux - Networking 2 07-13-2012 05:16 AM
Redirect traffic between ssh tunnels with iptables AresiusXP Linux - Networking 10 03-08-2012 01:59 PM
iptables redirect local ip traffic roof-us Linux - Networking 3 12-07-2011 09:56 AM
Using IPTABLES to redirect web traffic to another network. slugman92 Linux - Networking 1 04-20-2011 05:41 PM
[HELP] redirect traffic to spesific port based on Traffic Content using iptables summersgone Linux - Server 2 06-22-2009 11:26 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:34 AM.

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