Manual:$wgBadRanges

Details
User agent/range blocking.

Blocks all users using a particular user agent, possibly restricted to a set of IP ranges.

This setting holds an array of arrays of IP addresses that each value in  apply to.

e.g. array( array( '1.2.3.0', '1.2.3.255' ) )