LinuxQuestions.org
Register a domain and help support LQ
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-16-2007, 07:55 AM   #1
saifurab
Member
 
Registered: Mar 2007
Posts: 30

Rep: Reputation: 15
linux box router & port forwarding


Dear Experts

I have installed Fedora 7.0 and i want my linux box act as router. My scenerio is

DSL router : 192.168.1.254

Linux box eth1 connected with DSL router and its IP is 192.168.1.253

Linux box eth0 connected with LAN switch and its IP is 10.0.0.254

Default gateway on linux box is 192.168.1.254

The linux box working as gateway and transparent proxy is also working fine


I have mail MS Exchange server with OWA and OMA and its ip address is 10.0.0.5

Now i want that the traffic for the ports 25, 143 and 80 reached on my linux box must be forwarded to my server which has IP 10.0.0.5


Please help me in this regards

Thanks
Saif ur Rab
 
Old 08-17-2007, 02:35 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Moved: This thread is more suitable in Linux - Networking and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-17-2007, 02:01 PM   #3
rs_vijay
Member
 
Registered: Aug 2006
Location: Allahabad,India
Distribution: Fedora Core 5
Posts: 41

Rep: Reputation: 15
well, if i'm correct u need to forward connections on 192.168.1.253:25 to 10.0.0.5:25 ..
so to my knowledge.. on ur linux box with eth0 and eth1,
1) u can use rinetd , a port forwarding daemon to forward traffic on
192.168.1.253:25 to 10.0.0.5:25 or
2) u can use ssh's local port forwarding , might be
ssh -fNL 192.168.1.253:25:10.0.0.5:25 root@127.0.0.1 sleep 1
refer to the manual of ssh

hope this helps and plzz correct me if i'm wrong..
cheers,
vijay

Last edited by rs_vijay; 08-17-2007 at 02:04 PM.
 
Old 08-17-2007, 05:36 PM   #4
framp
Member
 
Registered: Apr 2003
Location: Stuttgart, BW Germany
Distribution: SuSE 10.3-11.0, Knoppix, Ubuntu 8.10, Fedora 10
Posts: 119
Blog Entries: 5

Rep: Reputation: 15
Use iptables to forward and redirect the external port requests to an internal IP address.

Example:
Code:
iptables -t nat -I PREROUTING -i dsl0 -p tcp --dport 80 -j DNAT --to 10.0.0.5 # forward all input traffic to port 80 to IP 10.0.0.5
iptables -I FORWARD -p tcp -i dsl0 -o eth0 s -0/0 -d 10.0.0.5 -j ACCEPT # enable forwarding of all requests to IP 10.0.0.5 in general
Adapt eth0 and dsl0 according your actual NW config.

Last edited by framp; 08-17-2007 at 05:38 PM.
 
  


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
port forwarding on Belkin 4-port Cable/DSL Gateway Router sycamorex Linux - Networking 5 03-05-2007 04:27 PM
Router box forwarding IP addresses to main server? jmj99385 Linux - Networking 1 05-05-2006 05:25 PM


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