LinuxQuestions.org
Visit Jeremy's Blog.
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 05-27-2018, 08:17 PM   #1
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 85

Rep: Reputation: 1
Red face bad subnet number/mask combination


Hi All,

I have been trying to install my DHCP server. I am seeing this error message after I typed:

systemctl status -l dhcpd

active: failed

The error messages followed after that. And I get this "bad subnet number/mask combination" error message.

My IP is 192.168.1.138 and netmask is 255.255.255.0 (I acquired these addresses after I typed ifconfig).
Then I set my network setting to these addresses.

And the error says there is an indication that the last "0" is the bad choice. I have also tried /30, and still didn't work.

And now this system is not even connected to the internet (server not found), although the connection is good. Nothing wrong with router, or the modem.
But if I typed 192.168.1.138, my Apache server is up.

What else can I try?

By the way, I am using CentOS7.

#Basic subnet declaration#
subnet 192.168.1.138 netmask 255.255.255.0 {
range 192.168.1.150 192.168.1.160;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}



Thank you all for your help,
Denny

Last edited by DennyY; 05-27-2018 at 09:12 PM. Reason: Need to add an additiaonal info.
 
Old 05-27-2018, 08:23 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
We would need to know more to understand your issue. But...
mask 255.255.255.0 would match the format /24 not /30.

What is at 192.168.1.138? Is that your DHCP server address, or your workstation node (dhcp client) address?
Is that also your router and so your default gateway, or is that another node?
WHERE are you seeing this error message, at the server, the client, or elsewhere? And under what conditions or in what file?
 
1 members found this post helpful.
Old 05-27-2018, 08:27 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Could you provide more information about the what you have done? The exact text of the relevant portions of configuration files would likely be most helpful; be sure to surround them with "code" tags, which become available when you click the "Go Advanced" button beneath the "compose post" window.

This article should help: https://www.centos.org/docs/5/html/D...ng-server.html

In addition, you may wish to read this: https://www.linuxquestions.org/linux...Ask_a_Question The more information you provide, the easier it is for others to help you.

Oh, and welcome to LQ.
 
Old 05-27-2018, 08:32 PM   #4
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 85

Original Poster
Rep: Reputation: 1
Smile bad subnet number/mask combination

Hello....

192.168.1.138 is the IP address for this DHCP server AND the for the network setting. My dhcp client is on another machine.

This DHCP server is connected to a router.

I am seeing this message after I typed:

systemctl status -l dhcpd

active: failed

and the error messages followed after that.

Thanks again,
Denny








Quote:
Originally Posted by wpeckham View Post
We would need to know more to understand your issue. But...
mask 255.255.255.0 would match the format /24 not /30.

What is at 192.168.1.138? Is that your DHCP server address, or your workstation node (dhcp client) address?
Is that also your router and so your default gateway, or is that another node?
WHERE are you seeing this error message, at the server, the client, or elsewhere? And under what conditions or in what file?
 
Old 05-27-2018, 09:16 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Quote:
192.168.1.138 is the IP address for this DHCP server AND the for the network setting.
I am not sure what you are trying to say here. You might need to provide more information on your network configuration but the subnet should be

Code:
subnet 192.168.1.0 netmask 255.255.255.0 {


}
 
1 members found this post helpful.
Old 05-27-2018, 10:54 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
#Basic subnet declaration#
subnet 192.168.1.138 netmask 255.255.255.0 {
range 192.168.1.150 192.168.1.160;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}
Well, 192.168.1.138 is not within the range 192.168.1.150-160.
 
1 members found this post helpful.
Old 05-28-2018, 12:01 AM   #7
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 85

Original Poster
Rep: Reputation: 1
Question bad subnet number/mask combination

Hi,

Can I have the range 192.168.1.136 192.168.1.160;
?

Thanks again,
Denny




Quote:
Originally Posted by AwesomeMachine View Post
Well, 192.168.1.138 is not within the range 192.168.1.150-160.

Last edited by DennyY; 05-28-2018 at 12:01 AM. Reason: wrong number
 
Old 05-28-2018, 05:16 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
The range can be anything within 192.168.1.1 - 1.192.168.254 but it can not include the router and the IP address of the DHCP server itself. You can also have multiple ranges. The DHCP server does have a static IP address?
 
  


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
bad subnet number/mask combination. Jan Tanjo Linux - Server 3 01-27-2013 09:20 PM
DHCP:bad subnet/mask combination mahdit Linux - Networking 2 01-07-2010 11:02 AM
DHCP: Bad subnet number/mask combination OliXNet Linux - Networking 4 01-07-2010 10:17 AM
dhcp - bad subnet/mask combination ecunningham Linux - Server 2 03-19-2009 08:19 AM
dhcpd server problem: bad subnet number/mask combination 144419855310001 Linux - Networking 2 09-13-2007 10:40 AM

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

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