LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-28-2012, 04:15 PM   #1
farenheitcx
LQ Newbie
 
Registered: Nov 2011
Posts: 8

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 1.1.1.1 ----- (internet ) -----> SERVER 2.2.2.2

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

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


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 04:16 PM.
 
Old 08-30-2012, 02:12 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

Here is a tutorial for doing the same thing: http://www.debuntu.org/how-to-redire...using-iptables

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


Reply

Tags
iptables


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


All times are GMT -5. The time now is 08:41 AM.

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