LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2004, 01:34 AM   #1
issin
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Rep: Reputation: 0
iptables how drop ip address


I want 192.168.1.123 can't connect to internet, other IP can connect to internet, what can I do for iptables?

Now, iptables:
#iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
 
Old 09-02-2004, 01:42 AM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
You can

iptables -I FORWARD -i <your internal NIC> -s 192.168.1.123 -j REJECT
 
Old 09-02-2004, 02:07 AM   #3
issin
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
thanks!
 
Old 09-02-2004, 02:38 AM   #4
issin
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
If drop some ip, can make ip list do it?
 
Old 09-02-2004, 06:45 AM   #5
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
You can do something like
http://www.linuxquestions.org/questi...615#post990615

replace the mac with ipaddresses

for exmple

iptables -N droplist
iptables -A droplist -s ! 192.168.1.124 -j RETURN
iptables -A droplist -s ! 192.168.1.154 -j RETURN
iptables -A droplist ACCEPT

iptables -A FORWARD .... -j droplist
 
  


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 - drop all -> allow needed OR allow all -> drop specific lucastic Linux - Security 5 12-21-2004 02:07 AM
Drop pings from specific IP address GUIPenguin Linux - Networking 10 10-13-2004 10:18 PM
how to do this.. IPTABLES IP Range DROP latino Linux - Security 1 01-02-2004 01:41 AM
iptables DROP command mm_jth Linux - Security 5 11-07-2003 11:22 AM
iptables -> DROP -> CLAGGS geoffj Linux - Networking 12 03-23-2003 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:51 PM.

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