LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-25-2003, 03:59 PM   #1
benazonafunk
LQ Newbie
 
Registered: Aug 2003
Posts: 10

Rep: Reputation: 0
Question simple bind and redirect example, please


I have a win2k running exchange and iis, i need to redirect ports for smtp, pop3 and http to my win2k server. i have 1 public ip address, and so everyone including the 2k server is NATing through the RH9 box. I've never done this before, and a simple example would be useful. Thank you in advance.
 
Old 08-25-2003, 07:28 PM   #2
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234

Rep: Reputation: 30
assuming 2.4.x kernel: read this, http://www.tldp.org/HOWTO/IP-Masquer...4.X-PREROUTING
 
Old 08-26-2003, 04:30 AM   #3
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
sparing u the security speech:

1. enable ip forwarding

#echo 1 > /proc/sys/net/ipv4/ip_forward

2. make a NAT/MASQ rule

#iptables -A POSTROUTING -t nat -s $LAN -j MASQUERADE (for a dynamic ip)
OR
#iptables -A POSTROUTING -t nat -s $LAN -j SNAT --to $NET_IP (if u have a static ip to internet)

where:

LAN=192.168.0.0/24 (or similar)
NET_IP=1.2.3.4 (your real IP to masquerade as)


with no other firewall rules setup, that should get you started with NATing


for redirecting ports 25 and 80 (aka port forwarding):

#iptables -A PREROUTING -t nat -p tcp --dport 25 -j DNAT --to $WINBLOWS_SERVER

#iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT --to $WINBLOWS_SERVER

and the same for the pop3 port

where:
WINBLOWS_SERVER=192.168.0.200 (or whatever the internal IP of it is).
 
Old 08-26-2003, 08:43 AM   #4
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234

Rep: Reputation: 30
I strongly suggest you read the article. It'll teach you how it works. If you just paste Robert's commands, you aren't learning anything. Linux is all about learning Have fun.
 
  


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
DNS (BIND)... Probably a simple problem dvergatal Linux - Networking 4 04-18-2005 12:04 PM
using bind to redirect to port setiDude Linux - Networking 8 11-17-2004 02:35 AM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 06:22 AM
Simple DNS/Bind tutorial cbernaut Linux - Networking 0 06-20-2002 12:22 AM
please help, simple question about redirect output kool Linux - General 4 03-18-2002 10:34 AM


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