LinuxQuestions.org
Review your favorite Linux distribution.
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 01-17-2006, 07:40 PM   #1
depam
Member
 
Registered: Sep 2005
Posts: 861

Rep: Reputation: 30
Forwarding using IPTables


For instance, i have a machine with two NICs...eth0 with a static IP and eth1 with a local address.

I want the machine to forward requests of port 80 to a certain machine having an IP of 192.168.1.140. Is it possible? How will I do it using the IP tables?

How can I set ip up in such a way that it will serve as a firewall and router at the same time?

Thanks in advance.
 
Old 01-19-2006, 04:30 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Yes this is possible, and is described in the myriad of iptables tutorials spread over the net. Go ahead and read one or two

Here is the basic rule though, to get you started:
Code:
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 192.168.1.140:80
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
help with iptables and forwarding laclac01 Linux - Networking 1 10-23-2005 07:16 AM
iptables forwarding... AnalyticaL Linux - Networking 5 09-28-2004 08:55 AM
Iptables Forwarding Help!! jglazner Linux - Networking 2 10-20-2003 05:04 PM
IP forwarding through iptables harshalupatel Linux - Networking 0 06-18-2003 01:29 PM

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

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