Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 2693)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -670,6 +670,17 @@
     def validate(self, field_data, all_data):
         validators.isValidIPAddress4(field_data, None)
 
+class CIDRAddressField(Field):
+    def __init__(self, *args, **kwargs):
+	kwargs['maxlength'] = 18
+	Field.__init__(self, *args, **kwargs)
+
+    def get_manipulator_field_objs(self):
+	return [forms.CIDRAddressField]
+
+    def valid(self, field_data, all_data):
+	validators.isValidCIDRAddress4(field_data, None)
+
 class NullBooleanField(Field):
     def __init__(self, *args, **kwargs):
         kwargs['null'] = True
Index: django/db/backends/ado_mssql/creation.py
===================================================================
--- django/db/backends/ado_mssql/creation.py	(revision 2693)
+++ django/db/backends/ado_mssql/creation.py	(working copy)
@@ -11,6 +11,7 @@
     'ImageField':        'varchar(100)',
     'IntegerField':      'int',
     'IPAddressField':    'char(15)',
+    'CIDRAddressField':  'char(18)',
     'ManyToManyField':   None,
     'NullBooleanField':  'bit',
     'OneToOneField':     'int',
Index: django/db/backends/postgresql/introspection.py
===================================================================
--- django/db/backends/postgresql/introspection.py	(revision 2693)
+++ django/db/backends/postgresql/introspection.py	(working copy)
@@ -74,6 +74,7 @@
     21: 'SmallIntegerField',
     23: 'IntegerField',
     25: 'TextField',
+    650: 'CIDRAddressField',
     869: 'IPAddressField',
     1043: 'CharField',
     1082: 'DateField',
Index: django/db/backends/postgresql/creation.py
===================================================================
--- django/db/backends/postgresql/creation.py	(revision 2693)
+++ django/db/backends/postgresql/creation.py	(working copy)
@@ -15,6 +15,7 @@
     'ImageField':        'varchar(100)',
     'IntegerField':      'integer',
     'IPAddressField':    'inet',
+    'CIDRAddressField':  'cidr',
     'ManyToManyField':   None,
     'NullBooleanField':  'boolean',
     'OneToOneField':     'integer',
Index: django/db/backends/sqlite3/creation.py
===================================================================
--- django/db/backends/sqlite3/creation.py	(revision 2693)
+++ django/db/backends/sqlite3/creation.py	(working copy)
@@ -14,6 +14,7 @@
     'ImageField':                   'varchar(100)',
     'IntegerField':                 'integer',
     'IPAddressField':               'char(15)',
+    'CIDRAddressField':             'char(18)',
     'ManyToManyField':              None,
     'NullBooleanField':             'bool',
     'OneToOneField':                'integer',
Index: django/db/backends/mysql/creation.py
===================================================================
--- django/db/backends/mysql/creation.py	(revision 2693)
+++ django/db/backends/mysql/creation.py	(working copy)
@@ -15,6 +15,7 @@
     'ImageField':        'varchar(100)',
     'IntegerField':      'integer',
     'IPAddressField':    'char(15)',
+    'CIDRAddressField':  'char(18)',
     'ManyToManyField':   None,
     'NullBooleanField':  'bool',
     'OneToOneField':     'integer',
Index: django/forms/__init__.py
===================================================================
--- django/forms/__init__.py	(revision 2693)
+++ django/forms/__init__.py	(working copy)
@@ -863,6 +863,17 @@
         return data or None
     html2python = staticmethod(html2python)
 
+class CIDRAddressField(TextField):
+    def __init__(self, field_name, length=18, maxlength=18, is_required=False, validator_list=[]):
+	validator_list = [self.isValidCIDRAddress] + validator_list
+	TextField.__init__(self, field_name, length=length, maxlength=maxlength,            is_required=is_required, validator_list=validator_list)
+
+    def isValidCIDRAddress(self, field_data, all_data):
+	try:
+      	   validators.isValidCIDRAddress4(field_data, all_data)
+	except validators.ValidationError, e:
+	   raise validators.CriticalValidationError, e.messages
+
 ####################
 # MISCELLANEOUS    #
 ####################
Index: django/core/validators.py
===================================================================
--- django/core/validators.py	(revision 2693)
+++ django/core/validators.py	(working copy)
@@ -23,6 +23,7 @@
 email_re = re.compile(r'^[A-Z0-9._%-][+A-Z0-9._%-]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$', re.IGNORECASE)
 integer_re = re.compile(r'^-?\d+$')
 ip4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
+ip4_cidr_re = re.compile(r'^([0-9]|1?\d\d|2[0-4]\d|25[0-5])\.([0-9]|1?\d\d|2[0-4]\d|25[0-5])\.([0-9]|1?\d\d|2[0-4]\d|25[0-5])\.([0-9]|1?\d\d|2[0-4]\d|25[0-5])(\/([1-9]|1\d|2\d|3[0-2]))$')
 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
 slug_re = re.compile(r'^[-\w]+$')
 url_re = re.compile(r'^https?://\S+$')
@@ -98,6 +99,31 @@
     if not ip4_re.search(field_data):
         raise ValidationError, gettext("Please enter a valid IP address.")
 
+def isValidCIDRAddress4(field_data, all_data):
+    if not ip4_cidr_re.search(field_data):
+	raise ValidationError, gettext("Please enter a valid CIDR address.")
+    cidr_parts = field_data.split('/')
+    if not 0 <= int(cidr_parts[1]) <= 32:
+	raise ValidationError, gettext("CIDR Mask not in valid range.")
+    inet_octets = cidr_parts[0].split('.')
+    inet_dec = 0L
+    inet_dec = inet_dec | (long(inet_octets[0]) << 24)
+    inet_dec = inet_dec | (long(inet_octets[1]) << 16)
+    inet_dec = inet_dec | (long(inet_octets[2]) << 8)
+    inet_dec = inet_dec | (long(inet_octets[3]))
+
+    inet_bin = ''
+    for i in xrange(0, 32):
+        if inet_dec & 1:
+           inet_bin = '1' + inet_bin
+        else:
+           inet_bin = '0' + inet_bin
+        inet_dec = inet_dec >> 1
+    for i in range(int(cidr_parts[1]), 32):
+	if int(inet_bin[i]) == 1:
+	   raise ValidationError, gettext("CIDR addresses must not have host bits.")
+    
+
 def isNotEmpty(field_data, all_data):
     if field_data.strip() == '':
         raise ValidationError, gettext("Empty values are not allowed here.")

