LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-09-2017, 12:30 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Rep: Reputation: Disabled
Accept all requests from 10. IP?


I thought I was suppose to use a zero for the last three ranges, but it appears that doing so does not all any IP such as 10.123.123.123 or 10.1.1.1 to get through. How should I be doing this? Thanks

Code:
14   ACCEPT     tcp  --  10.0.0.0/24          0.0.0.0/0           tcp dpt:445 state NEW

Last edited by NotionCommotion; 04-09-2017 at 12:57 AM.
 
Old 04-09-2017, 09:51 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,270

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Your netmask should be just the first 8 bits, not the first 24:
Code:
14   ACCEPT     tcp  --  10.0.0.0/8           0.0.0.0/0           tcp dpt:445 state NEW
 
1 members found this post helpful.
Old 04-09-2017, 11:17 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Your netmask should be just the first 8 bits, not the first 24:

Ah, I think I finally starting to get this IP thing. Let me explain my current understanding, and please correct me where I am wrong.

All IPv4 require 32 bits, and a given network can have?
  • (1) class A network with 2^24 IPs (16,777,216) where the remaining 8 bits are used to specify it is a class A network?
  • (16) class B networks with 2^20 IPs (1,048,576) where 8 of the remaining 12 bits are used to specify it is a class B network and the remaining 4 bits are used to specify which of the 16 (172.16 to 172.31) it is?
  • (256) class C networks with 2^16 IPs (65,536) where 8 of the remaining 16 bits are used to specify it is a class C network and the remaining 8 bits are used to specify which of the 256 (198.168 to ???) it is?

So, then these remaining 8, 12, or 16 bits are used to mask the IP so they don't conflict with others?

Yea, I am sure I am wrong multiple times!

Thanks in advance.
 
Old 04-09-2017, 07:38 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,705

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
This may help https://en.wikipedia.org/wiki/Subnetwork and this IP Calc to play with http://www.jodies.de/ipcalc - very informative.

The /8 (aka Class A) means use the FIRST 8 bits as the network address and the remaining 24 bits as host addresses etc
 
1 members found this post helpful.
Old 04-09-2017, 08:18 PM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Original Poster
Rep: Reputation: Disabled
Thanks chrism01, I think playing with the calculator will help it sink in.
 
Old 04-10-2017, 06:00 AM   #6
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
To be fair, Class A, Class B and Class C subnetworking isn't really used anymore, rather everything went to CIDR notation where Class A is equiv of a /8, Class B a /16 and Class C a /24 where the notation indicates the number of bits within the network address. CIDR is generally all round better, tho I am guessing Colleges and Universities probably still the old class style of subnetworking... cas those places usually get stuck in the past.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Installing OpenCA - Server is not online or does not accept requests invader7 Linux - Software 0 03-02-2013 04:45 AM
terminal will not accept anything brookshire Linux - Newbie 9 06-26-2009 06:12 AM
How to Accept SMTP Requests for Subnet Only nytcrwlr70 Linux - Security 4 07-07-2007 02:21 AM
-P ACCEPT vs -j ACCEPT Wynd Linux - Networking 3 05-30-2006 09:42 AM
HTTPS accept??? petey *BSD 6 06-23-2004 08:55 AM

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

All times are GMT -5. The time now is 10:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration