LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2003, 08:55 AM   #1
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Rep: Reputation: 15
Angry IPTABLES redirect question


Hi all,

We've got two RedHat 7.2 servers (A and B) in our LAN. Server A has 2
network cards, one is 202.x.x.1(eth0) and the other is 192.168.x.1(eth1).
Server B has only one network card and the IP address is 192.168.x.2(eth0).
We can access server A and even our LAN from outside. Now I want do such
kind of work, through which we can browse the APACHE website on server B.
That means when someone browse http://202.x.x.1:80, server A will forward
this request to server B, that is 192.168.x.2:80. This is the command I
typed on server A: $iptables -t nat -A PREROUTING -i eth0 -p tcp -s 0/0 -d
localhost --dport 80 -j DNAT --to 192.168.x.2:80.
But I'm sure that's a wrong method, since I still see the apache test page
on server A, instead of formal website on server B.
Please give me some advice.
Any help will be appreciated.

zuohong
 
Old 01-01-2003, 09:10 AM   #2
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Original Poster
Rep: Reputation: 15
Something to supplement: Server A does the NAT work for the whole LAN using iptables POSTROUTING chain, including server B.
 
Old 01-01-2003, 11:47 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
http://www.linuxquestions.org/questi...threadid=39970

surely you know better that to double post by now?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables redirect patvrs Linux - Networking 15 08-02-2005 09:31 AM
iptables redirect _ben_deb_ Linux - Networking 7 11-13-2004 06:06 AM
Iptables Redirect Question x86br Linux - Security 1 09-22-2004 09:48 AM
IPTABLES redirect question yuzuohong Linux - Networking 3 01-01-2003 10:30 PM
iptables redirect bhartnett Linux - Networking 1 09-26-2001 10:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:11 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
Open Source Consulting | Domain Registration