LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-20-2010, 02:41 AM   #1
pswen
LQ Newbie
 
Registered: Dec 2008
Posts: 26

Rep: Reputation: 0
iptables PREROUTING ,


LinuxA & LinuxB
linuxA:eth0(10.1.1.1) connected linuxB:eth0 (10.1.1.2)
linuxA:eth1(202.1.20.45) connected internet
linuxB:eth1(202.1.20.46) connected internet

LinuxA & LinuxB gw 202.1.20.33
user via internet access LinuxA tcp port 1935 , LinuxA trans this port to LinxB port 1935,

On LinuxA ,setting:
Iptables t nat A PREROUTING d 202.1.20.45
p tcp dort 1935 -j DNAT to 10.1.1.2:1935
iptables -t nat -A POSTROUTING -s 10.1.1.2
--sport 1935 -j**SNAT --to 202.1.20.45

but failed , because gateway ? any other ways ?
Attached Images
File Type: jpg Snap2.jpg (62.2 KB, 7 views)
 
Old 10-20-2010, 02:53 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 658

Rep: Reputation: 66
Iptables –t nat –A PREROUTING –d 202.1.20.45
Does this statement is valid on LinuxA , which data is going on destionation 202.1.20.45 from linuxA ? I mean 202.1.20.45 is source ip not destination for originating data.

Thanks
 
Old 10-20-2010, 03:37 AM   #3
pswen
LQ Newbie
 
Registered: Dec 2008
Posts: 26

Original Poster
Rep: Reputation: 0
tcpdump on LnuxA:

[root@hz2 ~]# tcpdump port 1935 -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
15:52:40.765232 IP 209.158.224.171.43415 > 202.1.20.45.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
15:52:40.771153 IP 209.158.224.171.43415 > 202.1.20.46.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
15:52:43.726252 IP 209.158.224.171.43415 > 202.1.20.45.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
15:52:43.726270 IP 209.158.224.171.43415 > 202.1.20.46.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
15:52:49.660801 IP 209.158.224.171.43415 > 202.1.20.45.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
15:52:49.660819 IP 209.158.224.171.43415 > 202.1.20.46.macromedia-fcs: S 1076020852:1076020852(0) win 65535 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>

209.158.224.171 is USER's IP
 
  


Reply


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
[HELP]IPTables PREROUTING Rules sangprabv Linux - Networking 2 05-22-2010 08:16 PM
iptables PREROUTING on all hosts but a couple paziulek Linux - Security 4 06-26-2009 09:27 AM
IPTables Prerouting Question ALInux Linux - Networking 3 06-11-2009 01:29 PM
IPTABLES prerouting - works sometimes czezz Linux - Networking 1 02-23-2009 06:00 AM
Iptables+prerouting niranjan_mr Linux - Networking 1 04-19-2005 12:23 PM


All times are GMT -5. The time now is 06:25 PM.

Main Menu
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