LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 04-19-2007, 01:36 AM   #1
sanjibgupta
Member
 
Registered: Apr 2003
Location: Kolkata
Posts: 215

Rep: Reputation: 30
Dnat


Hi
I want to dnat a ip to another ip on port 80

iptables -t nat -A PREROUTING -p tcp -d 202.141.xxx.28 --dport 80 -j DNAT --to-destination 202.141.xxx.29

after this i have done
root@mail root]# service iptables status
Table: nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere 202.141.xxx.28 tcp dpt:http to:202.141.xxx.29

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Table: filter
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


But when i know want to see the webpage of 202.141.xxx.28 it show the page in 202.141.xxx.28 machine instead of showin that of 202.141.xxx.29

what should i do so that i can see the webpage of 202.141.xxx.29 machine asking for 202.141.xxx.28.
Thanks
Sanjib Gupta
 
Old 04-19-2007, 04:08 AM   #2
sin
LQ Newbie
 
Registered: Jun 2005
Location: UK
Distribution: Slackware
Posts: 28

Rep: Reputation: 15
the rule looks fine,

have you activated ip forwarding ?

also you could try

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 202.141.xxx.29

just in case your connection isnt comming in on the interface your trying to redirect from.
 
Old 04-19-2007, 04:56 AM   #3
sanjibgupta
Member
 
Registered: Apr 2003
Location: Kolkata
Posts: 215

Original Poster
Rep: Reputation: 30
if i just see the 202.141.xxx.29 directly i can see the webpage. But is not redirectd from 202.141.xxx.28.
Please send me accrosssteps to be done.

Sanjib Gupta
 
  


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
dnat module jelgavchik Linux - Networking 1 01-18-2005 07:52 AM
dnat kapcreations Linux - Networking 1 12-28-2004 04:12 PM
iptables DNAT pshepperd Linux - Security 1 05-22-2004 03:56 PM
Rules before DNAT Jacky1668 Linux - Security 2 05-17-2004 10:16 PM
IP Tables DNAT hakcenter Linux - Networking 5 11-02-2003 10:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:40 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