We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,414 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

iptables question

What iptables chain would give me drop all request except those from the local subnet

so iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT would accept
im looking for iptables -A INPUT ! -s 192.168.1.0/24 -j DROP equivalent ??

What Im not looking for is
DROP ALL Connections,
then
Accept localsubnet
(trivial)

thnx

2
Contributors
1
Reply
2 Days
Discussion Span
10 Months Ago
Last Updated
2
Views
coding101
Junior Poster in Training
74 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This should do the task:

iptables -P INPUT DROP
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT

As a matter a fact this does first allow all the connections in the iptables rules and what is not allowed in the list is dropped.

What Im not looking for is
DROP ALL Connections,

then
Accept localsubnet

This is not possible. If you drop all connections after this you cannot allow localsubnet because it is already dropped.

slacke
Junior Poster
112 posts since Jun 2006
Reputation Points: 14
Solved Threads: 8
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0599 seconds using 2.65MB