LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 02-10-2002, 09:55 PM   #1
jamesws
LQ Newbie
 
Registered: Feb 2002
Posts: 3

Rep: Reputation: 0
Unhappy Need Help with Firewall, iptables!!!!


I'm in need of help.

I can't get access to the internal web server form the outside externat ip

I have a firewall setup.
The internal lan can access the web.

I tried to setup Portfordwarding to an internal web server on port 80 ip 192.168.254.15.

here is the script I'm using.
I replaced my EXTIP with X

#!/bin/sh

PATH=/sbin:$PATH; export PATH

iptables -F
iptables -F -t nat
iptables -X

EXTIP=XXX.XXX.XXX.XXX
EXTNET=eth1
INTNET=eth0


iptables -t nat -A PREROUTING -p tcp --destination 440 -j ACCEPT

iptables -t nat -A PREROUTING -p TCP -i eth1 -d 204.$EXTIP --dport 80 -j DNAT --to 192.168.254.15:80

iptables -N firewall
iptables -A firewall -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A firewall -m state --state NEW -i ! $IFINET -j ACCEPT
iptables -A firewall -s 127.0.0.1 -d 127.0.0.1 -i lo -j ACCEPT
iptables -A firewall -s 127.0.0.1 -d 192.168.254.0/24 -i lo -j ACCEPT
iptables -A firewall -d 127.0.0.1 -s 192.168.254.0/24 -i lo -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -p tcp -i eth1 -j ACCEPT

iptables -A INPUT -j firewall
iptables -A FORWARD -j firewall

iptables -A INPUT -j DROP

iptables -t nat -A POSTROUTING -o $EXTNET -j SNAT --to $EXTIP

iptables -A FORWARD -p TCP -i eth1 -o eth0 -d 192.168.254.15 --dport 80 -j ACCEPT

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

Last edited by jamesws; 02-11-2002 at 05:53 PM.
 
Old 02-11-2002, 06:17 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
huh? I don't see a question anywhere....
 
Old 02-11-2002, 05:56 PM   #3
jamesws
LQ Newbie
 
Registered: Feb 2002
Posts: 3

Original Poster
Rep: Reputation: 0
Issue

I can't get access to the internal web server from the external ip.

Please Help!!!!

Thanks
 
  


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
Iptables with iptables-firewall.conf arno's matt3333 Slackware 16 06-28-2007 07:20 AM
iptables and firewall J4b0l Linux - Security 5 10-10-2005 08:02 AM
IPTABLES firewall Vs rc firewall netguy2000 Linux - Security 7 02-28-2004 04:31 AM
firewall iptables SchwipSchwap Linux - Newbie 2 09-14-2002 06:41 AM
IPTables Firewall bfloeagle Linux - Security 6 06-19-2001 02:51 PM


All times are GMT -5. The time now is 10:13 AM.

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