LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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: 27

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 Thumbnails
Click image for larger version

Name:	Snap2.jpg
Views:	23
Size:	62.2 KB
ID:	4911  
 
Old 10-20-2010, 02:53 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

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: 27

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:17 PM.

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
Open Source Consulting | Domain Registration