nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

iptables help

This is a discussion on iptables help within the Networking, Firewalls and Security forums, part of the Mastering Servers category; Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 192.168.0.1 anywhere tcp dpt:ssh DROP tcp -- anywhere ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-21-2007, 12:15 PM
Junior Member
User
 
Join Date: Aug 2007
My distro: redhat
Posts: 3
Rep Power: 0
vitaminme is on a distinguished road
Default iptables help

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 192.168.0.1 anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:squid
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:netbios-ssn
ACCEPT tcp -- anywhere anywhere tcp dpt:netbios-ssn

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (0 reference
target prot opt source destination

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


Here's what my iptables looks like.
if i append a below line in input policy internet on client machine stops workin. just want the reason why internet stops workin
iptables -A INPUT -j DROP
even forwarding is enabled "net.ipv4.ip_forward = 1"

or should i set input policy as drop "iptables -P INPUT DROP"

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-04-2007, 02:42 AM
Junior Member
User
 
Join Date: Aug 2007
My distro: fedora
Posts: 8
Rep Power: 0
dancave is on a distinguished road
Default

with iptables, the first rule matches, so you might want to make the first rule of your chain a default deny all, then allow all others after that..

berkley packet filter is the same, but much easier to understand

vis.(for example)

block all on interface eth0 #lan interface
block all on interface eth1 #dmz interface

pass in on eth0 from 192.168.0.0/24 to dmz-network on port 22 keep state
pass in on eth1 from any to 192.168.1/26 on port 22 keep state

So the first rule which matches, catches the packet and the bpf0 interface stops filtering.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Iptables nixsen CentOS / RHEL / Fedora 2 11-29-2007 03:01 PM
IPTABLES Help asim.mcp Linux software 3 07-08-2006 02:53 AM
IPTABLES help vasanth Linux software 1 03-09-2005 09:15 AM


All times are GMT +5.5. The time now is 07:40 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36