LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-08-2005, 05:06 PM   #1
lamiczka
Member
 
Registered: Feb 2004
Location: EU
Distribution: Fedora
Posts: 62

Rep: Reputation: 15
Need help with iptables...




I got iptables on my router. In my LAN I got a webserver. I need to forward requests to it, but cant figure it out.... anyone can help me??

iptables -t nat -A PREROUTING -p tcp --source-port 80 -s 62.240.165.131 -j DNAT --to-destination 192.168.1.10:80
iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 80 -d 192.168.1.10 -j ACCEPT

what am I doing wrong?
 
Old 11-08-2005, 06:36 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
This should be what you are after.
iptables -A ALLOW_PORTS -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -d 62.240.165.131 --dport 80 -j DNAT --to-destination 192.168.1.10:80

Brian1
 
Old 11-09-2005, 08:11 AM   #3
lamiczka
Member
 
Registered: Feb 2004
Location: EU
Distribution: Fedora
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Brian1
This should be what you are after.
iptables -A ALLOW_PORTS -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -d 62.240.165.131 --dport 80 -j DNAT --to-destination 192.168.1.10:80

Brian1
Does not work either......

I really dont know what to do now
 
Old 11-09-2005, 05:53 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Post your entire iptables script.

Brian1
 
  


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
An error occured getting IPtables status from the command /etc/rc.d/init.d/iptables s CrazyMAzeY Linux - Newbie 10 08-12-2010 05:25 AM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 02:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 04:38 PM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

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

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