LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-25-2007, 05:43 PM   #1
conrado
LQ Newbie
 
Registered: Apr 2006
Distribution: Slackware-Current
Posts: 23

Rep: Reputation: 15
Block and allow with Iptables help!


I have a router running in slackware 11.0 I need to block all my local network so they can't access internet, I know I can use:

iptables -I INPUT 192.168.0.0/24 -j DROP

this works Ok, but I want to allow access to internet to:

192.168.0.45
192.168.0.37

They are inside the IP range of 192.168.0.0/24 how do I allow these 2 local IP to connect to internet, whitout allowing the rest of my LAN to also connect.
 
Old 10-26-2007, 09:51 AM   #2
conrado
LQ Newbie
 
Registered: Apr 2006
Distribution: Slackware-Current
Posts: 23

Original Poster
Rep: Reputation: 15
I find a solution for this

Since this rule block all IP for a entire range

iptables -s 192.168.1.0/24 -j DROP

I just add the IP I didn't want to block

iptables -s 192.168.1.30 -j ACCEPT

This solved my issue, but thanks
 
Old 10-26-2007, 10:31 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Thanks for taking the time to post the solution. Not only did you save us from writing the answer, but you also added another solution to the LQ archive.
 
  


Reply



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 p2p block jibskg Linux - Security 8 05-17-2010 02:27 AM
iptables-p2p - Instalation problems | How to block p2p with iptables Woping Linux - Networking 0 03-14-2006 12:56 PM
IPTables and PPTPD :S (to block or not to block) thewonka Linux - Networking 0 03-24-2005 06:58 PM
IPtables - Block all except what I allow ]SK[ Linux - Software 4 02-10-2005 06:14 AM
iptables, block port 80? frank2 Linux - Security 4 09-12-2004 09:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration