How do I deny connections with an IP range?

Joined
Mar 18, 2016
Messages
13
Reaction score
0
Points
1
Hello guys

I would like to know how do I deny incoming and outgoing connections with an IP range? (for example 1.1.1.1 - 1.1.1.255)

I want to perform this task directly into the OS without using any third party software like Little Snitch or DNS or router filtering.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
How large a range? You could do it in the host file, but each ip would have to be on it's own line.
 
M

MacInWin

Guest
You were given two ways, one that is free but labor intensive and one that is easy, but may cost a bit for the product.
 
Joined
Apr 26, 2008
Messages
2,963
Reaction score
120
Points
63
Location
Belgium
Your Mac's Specs
iPad Pro 12.9 latest iOS
Just curious ..... why would you want to do such a thing ( directly in the OS ) ?

Cheers ... McBie
 
OP
M
Joined
Mar 18, 2016
Messages
13
Reaction score
0
Points
1
You were given two ways, one that is free but labor intensive and one that is easy, but may cost a bit for the product.

I don't want to be rude or to offend anyone. I am aware I am here for help but if a member ask for a way to accomplish something without using the app Little Snitch and another member suggest using the exactly Little Snitch app, is this considerate a solution?
 
Last edited:

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
I don't think anyone is trying to be rude. Little Snitch may be the best way to do what you want (exclude a range of IP addresses). That's why we were asking exactly what you were trying to do and why it needs to be done without other software such as Little Snitch.
 
Joined
May 19, 2009
Messages
8,428
Reaction score
295
Points
83
Location
Waiting for a mate . . .
Your Mac's Specs
21" iMac 2.9Ghz 16GB RAM - 10.11.3, iPhone6s & iPad Air 2 - iOS 9.2.1, ATV 4Th Gen tvOS, ATV3
I don't want to be rude or to offend anyone. I am aware I am here for help but if a member ask for a way to accomplish something without using the app Little Snitch and another member suggest using the exactly Little Snitch app, is this considerate a solution?

I know that Cradom knows his networking and Terminal stuff, and as his solution, is as mentioned above, labour intensive, I put down Little Snitch, as it's the only way I know to get this done, in a few clicks.
And to be totally honest, I didn't read through the whole post :( Sorry
 
Joined
Oct 16, 2010
Messages
18,146
Reaction score
1,899
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
M

MacInWin

Guest
I don't want to be rude or to offend anyone. I am aware I am here for help but if a member ask for a way to accomplish something without using the app Little Snitch and another member suggest using the exactly Little Snitch app, is this considerate a solution?
Cradom gave you a free way, no third party, but it is labor intensive. You asked for that, and got it. That is why I said what I said.
 
OP
M
Joined
Mar 18, 2016
Messages
13
Reaction score
0
Points
1
You can't block connections with an IP in the host file, this is only used for hostnames.
Unfortunately English is not my first language so I don't know how to explain any better then this:

Does anyone know a way to deny incoming and outgoing connections with the IP range 200.200.200.1 - 200.200.200.255 directly into the OS X without using Little Snitch (or any other third party software) or private DNS or router filtering.

Thank you
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
man pfctl


if that doesn't make sense to you, you probably shouldn't mess with it.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top