LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2009, 06:36 AM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
CIDR explanantion?


I've been looking up CIDR but can't really get an explanation on anything that isn't 8bit, 24, etc.
I currently use this rule in a .htaccess file to restrict logins to the admin pages from my ISPs range:
Order Deny,Allow
Deny from all
Allow from 81.128.0.0/11

It works but my IP address is 81.159.xxx.xxx
I'm not really sure how the 11 factors into the equation?

I was going to use the same in iptables
 
Old 08-18-2009, 06:54 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by qwertyjjj View Post
I've been looking up CIDR but can't really get an explanation on anything that isn't 8bit, 24, etc.
I currently use this rule in a .htaccess file to restrict logins to the admin pages from my ISPs range:
Order Deny,Allow
Deny from all
Allow from 81.128.0.0/11

It works but my IP address is 81.159.xxx.xxx
I'm not really sure how the 11 factors into the equation?

I was going to use the same in iptables
there is a short but sweet explanation on wiki
Code:
en.wikipedia.org/wiki/CIDR_notation
loads of detailed explanations too on the web. i didnt really understand it properly until i did the ccna.. so you may have to read up some good books for a 'proper' understanding


even shorter and sweeter is the iptab command or ipcalc which will work it all out for you if you give the relevant flags
 
Old 08-18-2009, 07:02 AM   #3
timvandijk039
Member
 
Registered: Jul 2009
Location: The Netherlands
Distribution: Debian/Ubuntu and RHEL/CentOS
Posts: 42

Rep: Reputation: 18
Hi qwertyjjj,

The 11 points out how many bits of the subnet is reserved for the subnet. In your case that would be 11 bits. The decimal subnet-notation of an 11 bit subnetmask would be 255.224.0.0.

With a network-id of 81.128.0.0 and an 11 bits subnet, the host range will be from 81.128.0.1 until 81.159.255.254. Your IP number (81.159.xxx.xxx) should fit fine within these boundaries. So everything is peachy indeed :-)

Cheers...
 
  


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
bash CIDR calculator genderbender Programming 18 10-29-2014 10:13 AM
C cidr argv quantt Programming 11 01-26-2009 07:03 AM
LXer: Tutorial: Networking 101: Understanding Subnets and CIDR LXer Syndicated Linux News 0 07-31-2008 02:40 AM
Understanding CIDR notation for iptables Madone_SL_5.5 Linux - Networking 5 12-07-2007 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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