LinuxQuestions.org
Visit Jeremy's Blog.
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 06-28-2009, 02:40 PM   #1
modpriest
Member
 
Registered: Dec 2007
Posts: 32

Rep: Reputation: Disabled
Question how to setup tcp stop going 1 ip address?


any idea how this was done? i hear they said iptables can do it... but i don't know how! anyone?
 
Old 06-28-2009, 03:04 PM   #2
modpriest
Member
 
Registered: Dec 2007
Posts: 32

Original Poster
Rep: Reputation: Disabled
i was able to block 1 ip:

#iptables -A OUTPUT -p tcp -d 192.168.2.3 -j DROP

but how do i block ip from

192.168.2.1 to 192.168.2.255 ???? please help me!
 
Old 06-28-2009, 04:19 PM   #3
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Quote:
Originally Posted by modpriest View Post
but how do i block ip from

192.168.2.1 to 192.168.2.255 ???? please help me!

#iptables -A OUTPUT -p tcp -d 192.168.2.0/24 -j DROP
 
Old 06-28-2009, 04:34 PM   #4
LeeDaugherty
LQ Newbie
 
Registered: Jun 2009
Location: Grapevine, TX
Distribution: Ubuntu Jaunty (Netbook-Remix)
Posts: 7

Rep: Reputation: 0
Be advised the above command will 'DROP' all TCP protocol packets whose Destination falls in the 192.168.2 subnet...(This command follows with your previous "1 IP command") If you want to be even more restrictive (or paranoid) change -p to ALL (choices are TCP, UDP, and ICMP (or ALL)...If you are trying to restrict incoming requests then you need to replace -d with -s for "Source". Be advised these commands might isolate you on the network if you happen to have an address within that subnet block depending on the order of your iptable rules. UFW can help out here as well...check it out 'man ufw'
 
Old 06-29-2009, 03:59 AM   #5
modpriest
Member
 
Registered: Dec 2007
Posts: 32

Original Poster
Rep: Reputation: Disabled
Wink

ok, i done it, thank alot guy! ur guy are great!
 
  


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
Send email when TCP/IP address changes scherfistv Linux - Networking 3 07-11-2006 05:02 PM
3C509B can not connect over TCP/IP (gets DHCP address though) RSpendl Linux - Hardware 4 10-31-2005 06:56 AM
sun-dr/tcp: bind: Address already in use choonseng Solaris / OpenSolaris 2 10-18-2004 02:48 AM
remote administrating modems via MAC address instead of TCP/IP ID10T_error Linux - Networking 0 06-28-2004 11:27 AM
how to stop a connection to a specific UDP/TCP port? aromes Linux - Networking 2 03-04-2004 07:37 PM

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

All times are GMT -5. The time now is 12:48 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