Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
IPTABLES internal/external nic
Name: Kvetch Date: August 19, 2004 at 12:04:03 Pacific OS: RH E3 CPU/Ram: 2.4 XEON
Comment:
I can't seem to figure out what I am doing wrong with my IPTABLES rules. I have 2 nics on this machine. I wanted to trust everything from eth0 and deny everything but port 80 on external nic.
# iptables -F # iptables -A INPUT -i eth1 -s 192.168.1.0/24 -j REJECT - I want to reject spoofed addresses pretending to be my internal nic # iptables -A INPUT -i lo -j ACCEPT - accept everything on the loopback # iptables -A INPUT -i eth0 -j ACCEPT - except everything on the internal nic # iptables -A INPUT -p tcp --dport www -j ACCEPT - is limiting this to the eth1 needed? # iptables -A INPUT -j LOG -m limit # iptables -A INPUT -j REJECT # service iptables save
I restart iptables but then I am unable to ssh into eth0. Any ideas what is wrong in my config?
Name: 3Dave Date: August 20, 2004 at 01:13:57 Pacific
Reply:
FYI you can protect yourself against IP sppofing with: # echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
0
Response Number 2
Name: Kvetch Date: August 20, 2004 at 06:24:03 Pacific
Reply:
Thanks - I didn't mention that but I already set that. Thanks
0
Response Number 3
Name: 3Dave Date: August 20, 2004 at 06:44:55 Pacific
Reply:
You can probably leave out the "iptables -A INPUT -i eth1 -s 192.168.1.0/24 -j REJECT - I"
Why have the -I (I take it the "- I" is a typo for "-I") without a chain name when the rule is the first to be set? It looks as though eth1 will reject everything coming from 192.168.1.0/24 even if its eth0. If you want to use that rule you might want to add a destination pointing at you local lan...
Summary: Satish, Since u not mentioned u r Linux flavour, any how please follow my settings. We have Slackware system acts as a gateway system, with internal & external NICs.We use Iptables as firewall. Firew...
Summary: Hi. I set up iptables a couple of weeks ago, and after some trouble it worked the way i wanted. Im using the linux machine as a server/firewall/router and got a windowsXP machine running behind it. Ev...
Summary: Hi all, I'm writing a proposal to use a Linux firewall for my company rather than spend mucho dinero on a 'doze/Checkpoint solution. My question is this: My mailserver and webserver both sit behind t...