Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Iptables Help
post Aug 17 2003, 07:44 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 17-August 03
Member No.: 1,268

HI guys im i have 3 computers, all running redhat 7.3 fully patched. I have one computer that is dual homed which is connected to both the internet and the internal network. I have set up iptabless to masquerade and i have interenet connectivity on all my machines. Thats about as far as ive gotten...I want to set up an apache webserver on, which is a computer on my internal network. HOw do i set up iptables to deny everything to the outside world except my webserver on my internal network?

My current iptables script is:

iptables -F; iptables -t nat -F; iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <-------not my ip :-)
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptbles -P INPUT DROP

thanks everyone!
Go to the top of the page
+Quote Post
post Aug 19 2003, 02:13 PM
Post #2

LinuxHelp Admin

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1

I think this should work assuming that eth0 is connected to the internet and eth1 is the local network:

iptables -A INPUT -i eth0 -s 0/0 -d 0/0 -p tcp --dport 80 -j DROP
iptables -A INPUT -i eth1 -s 0/0 -d 0/0 -p tcp --dport 80 -j ACCEPT
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 16th July 2018 - 11:02 AM