Bad Subnet/netmask , DHCP Installation

Hi,

I'm on WMware workstation with debian Wheezy.
I have a problem when a restart the Dchp.
It said Bad subnet number/mask combination.

This is logs:

root@debian-main:/# /etc/init.d/isc-dhcp-server restart
dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
The error was:
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
/etc/dhcp/dhcpd.conf line 50: subnet 192.168.10.1 netmask 255.255.255.0: bad subnet number/mask combination.
subnet 192.168.10.1 netmask 255.255.255.0{
^
Configuration file errors encountered -- exiting

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.

And this my file dhcpd.conf:

# A slightly different configuration for an internal subnet.
subnet 192.168.10.1 netmask 255.255.255.0{
range 192.168.10.1 192.168.10.15;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
option routers 192.168.10.254;
option broadcast-address 192.168.10.255;
default-lease-time 600;
max-lease-time 7200;
}

For me it's the good subnet number/mask combination.

Can you help me please?

Thanks you,

Pierrick


Similar Content



Starting Dhcp Failed

I am novice at linux...I installed VMware work station and then install centos 6.4. Now I followed this tutorial to configure DHCP Server on my OS http://tecadmin.net/configuring-dhcp...centos-redhat/
but when start dhcp I see this : Starting dhcpd:[FAILED]
This is my /etc/dhcp/dhcpd.conf

option domain-name "center.local";
option domain-name-servers master.center.local;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-search "center.local";
option domain-name-servers 192.168.1.100;
option time-offset -18000; # Eastern Standard Time
range 192.168.1.100 192.168.1.120;
}

host station1 {
option host-name "centos-1.center.local";
hardware ethernet 00:11:1A:2B:3C:AB;
fixed-address 192.168.1.101;
}

so what is wrong?Any suggestion?
Thanks for your help and sorry for my bad English grammar

Dhcpd On Opensuse 12.1 Does Not Hand Out Addresses

Hi all

I am trying out this dhcp server setup on opensuse 12.1 but it does not seem to be working.

I have eth0 configured to be 192.168.10.1 in a /24 network.

I want to hand out the rest of the address in the same subnet as dhcp addresses. (So everything from 10.2 to 10.255). The default gw is defined as 192.168.10.1, and routing table looks correct. and I only have eth0.


When I start the dhcp, and connect it to the client machine, I see nothing on the wireshark trace. no DHCP discovery or ack messages. And the client machine just keeps trying boot from the network via the network interface. I know I got the right interface (there were blinky options in the bios that lets you identify the correct interface) and the cable is not a problem. (If the cable were a problem the client boot message would say "media fault ... please check media...") instead.

Here is my dhcpd.conf file. I went through man dhcpd already, and cleaned out everything that I apparently don't need. (The original file was copied from a more complicated setup that had multiple subnets and dhcp relays.)

Code:
###################simplfied 
linux-kzy1:/var/lib/dhcp/db # cat /etc/dhcpd.conf
authoritative;

ddns-update-style none;
ddns-updates off;

#Information about the host
subnet 192.168.10.0 netmask 255.255.255.0 {
  max-lease-time 600;
  default-lease-time 600;
  range 192.168.10.2 192.168.10.255;
}

group esx_gep{
  filename "pxelinux.0";
  next-server 192.168.10.1; 
  host testserver1 {hardware ethernet a0:d3:c1:f7:f2:64;}
}

this is what /var/log/message and /var/log/rc.dhcpd.log says:
Code:
**************var log message
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #


*****************var log rc.dhcpd.log
Mar 19 18:42:17 linux-kzy1 dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Mar 19 18:42:17 linux-kzy1 dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Mar 19 18:42:17 linux-kzy1 dhcpd: All rights reserved.
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #

not very interesting stuff or useful, but I found some other messages that is very interesting:

Code:
**********
#no free lease

linux-kzy1:/home/test/Documents # cat /var/log/messages | grep "free lease"
Mar 19 15:53:59 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:03 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:11 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
......
Mar 19 17:01:06 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 17:01:38 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
linux-kzy1:/home/test/Documents #

Which ties into my first question: dhcp no free lease: I googled a bit, I found a post from a guy on ubuntu who has the same error message and the suggested course of action is to change ownership of the lease file to dhcpd and give it 777 for permission. Which I thought is weird, because the lease file is automatically created by the dhcpd itself, so it really shouldn't be a permission issue shouldn't it? (Anyway, tried that didn't do a thing.) right now it is owned by root/root and has this permission: -rw-r--r--.

2nd question: once the client gets a reply from my dhcp server saying no free lease, does it remember this dhcp server as no free lease and does it persist throughout reboots? Because I tried rebooting the client a number of times and I don't see anything on the wireshark at all. You will notice the time stamp on the last "no free lease" message is not as late as the other messages from the var/log/messages or rc.dhcpd.log and I rebooted the client and the dhcp plenty of times since 17:01:38.



Thanks for all your help in advance everyone.

Failed To Bring Up Eth1 - Debian Wheezy

Hi,

I tried to configure my ethernet interface on a Debian Wheezy VM, but I've a problem. When I try to restart /etc/init.d/networking, I've no error message.
But my eth1 interface isn't up and when I try to up it with : ifup eth1, it return me :

Code:
root@debian-main:/# ifup eth1
RTNETLINK answers: File exists
Failed to bring up eth1

My /etc/network/interface file is :

Code:
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp


iface eth1 inet static
        address 192.168.10.1
        netmask 255.255.255.0
        gateway 192.168.10.254

Eth0 is my internet interface and eth1 is a local interface. I want to install a DNS and a DHCP server on eth1 to be able to connect client with this VM and give them an ip adress.

Thanks guys

How To Find Out What Subnet My Eth Belongs To

Hi all

I got this interesting problem:

I have a server that has two ethernet connections, cabled up to the switch.

The server has a clonezilla liveboot cd in it which I am currently booting from. The clonezilla is a debian OS.

So from the cmd line I can see I have two eth interfaces that is connected, eth0 and 2.

Now I need to configure one of these two interfaces to do let clonezilla do its job.

The problem is that each of these two interfaces are going to different subnets. I got the two subnets, which we will just call them A and B. And I can't recall whether A belongs on eth0 or B belongs there.

Now I know there is a simple solution to this: config one and try it out. I could do that, in fact I will do that just to save time. But I was wondering, cause when I did ifconfig I can see from the packet counters that these two interfaces are live, if there is some other way to monitor these two interfaces, and by looking at the packets that is being sent to these interfaces, I can determine which interface goes with which subnet?

Or phrased another way: you just installed a new computer, and have plugged in the internet cable, but you forgot to put an IP address on it and really don't want to wait for your IT guy to come in on monday to tell you what your IP is and dhcp is not an option. What do you do?

Thanks
Feel free to ask questions if anything is not clear.

Firewall Setup


I have an Intel x86_64 system running rhel 7.0 I want to use this system as a Firewall. The system has two NICs. one NIC is defined with the static IP address from my ISP. The other NIC is also static i.e. no dhcp, and is assigned a LAN addrs of 192.168.10.6 It is plugged into a switch (192.168.10.1) that has other three devices plugged in. Each with it's own hard-coded LAN address (Netmask is 255.255.255.0) I have two zones active in the firewall config External (using the static ip from the ISP) and Internal (using the IP addrs of 192.168.10.6) I'm forwarding the following two ports 80 & 443 in both zones. External zone: ports 80 & 443 are forwarded to my switch (192.168.10.1) Internal zone: ports 80 & 443 are forwarded to my static IP addrs from my ISP. I have IP masquerading turned on in the External zones. However none of the other workstations (Windows 7 professional) and my "smart" TV (netflix access) are able to access the internet. Again I'm NOT using any dhcp, all IP addresses are hard coded. I can ping any LAN address from any LAN node. The Linux FW machine can access the internet. I've read thru the RHEL 7.0 Security guide regarding setting up the firewall and I believe I have all the elements defined properly ... It just doesn't work. I have the same set of DNS values defined on all systems.
They are the three DNS servers assigned by my ISP. I have ipv4 forwarding active on my Linux system. I have masquerading "turned on" in the External zone. The resolv.conf file has the ip addresses of the DNS servers as well as my switch.
However the windows 7 systems and my "smart" TV cannot access the internet.
Anyone who's really familiar with rhel firewall-config GUI and has any suggestions please respond.
Thanks
Guy

Regular Expression In Expect Script To Prevent Printing To Screen

Hello, I have an expect script where I ssh to a remote host to determine the network configuration and get from the user the network interface card that should be used. From their response, I determine the subnet mask and save the information to a text file that is later transmitted back to my local host. This is all so that I can set up virtual IP aliasing and verify that the physical IP address of the local and remote host are on the same subnet prior to continuing with the setup. I am running the script on Linux, with expect version 5.45.

The code itelf works just fine, but I'm having some issues with how it displays on the screen. As you'll see below in the example, the default system prompt displays, as does the user input command that I'm sending to the shell from the expect script.

Is there a regular expression or something that I can write to prevent the prompt and command that I'm sending from printing to the screen? I know that it should be suppressed if I have an expect command following the Code:
send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r

command, but everything I have tried for strings and regular expressions to expect causes the netstat -rn output to not show up all of a sudden. I'm new to expect, so I'm not really sure why this is happening.

I would really appreciate any help/suggestions. Thanks for your time!

Part of the Script Code:
Code:
expect {
   -re $prompt {   ;# Send individual commands and get user input
        set timeout -1
        
        # Get partner hostname and put in vipsetup.txt file
        send -s "hostname > vipsetup.txt\r"  
        expect -re $prompt
        
        # Display the network routing info for the user and prompt for 
        # network interface card number
        send -s "print \"The network routing table for the $ptner server is displayed below:\n\" ; netstat -rn \r"
        
        expect -re "\r(.*):\r"
        send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r"
        interact "\r" return    ;# Wait for user input from read command
        send -- "\r"
        send -s "echo \$n_card >> vipsetup.txt\r"  
        
        # Obtain subnet mask information for partner based on network 
        # interface card number being used
        send -s "msk=\$(cat /etc/sysconfig/network-scripts/ifcfg-\$n_card | grep NETMASK)\r"
        send -s "msk=\$(echo \${msk#NETMASK=})\r"
        send -s "echo \$msk >> vipsetup.txt\r"
    }
    timeout {
        send_user "Connection to host $hostip timed out."
        exit 6 
    }
    eof {
        send_user "Connection to host $hostip failed."
        exit
    }
}


Script Output:
Code:
The network routing table for the PRIMARY server is displayed below:
 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.105.65.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         10.105.65.1     0.0.0.0         UG        0 0          0 eth0
 [root@remotehost root]$
[root@remotehost root]$ ber for this server (i.e. eth0):   '              < 
Enter the network interface card number for this server (i.e. eth0):   eth0

I Cannot Find My Honeyd Logs In Kali Linux

hey there
And again, I got stuck in this problem.
I could not find honeyd logs in var/logs/honeypot/
there isnt any file.

I ran the honeyd with "honeyd -d -f honeyd.conf"
it works in terminal. but there arent any logs at all.

root@kali:/etc/honeypot# honeyd -d -f honeyd.conf
Honeyd V1.5c Copyright (c) 2002-2007 Niels Provos
honeyd[6952]: started with -d -f honeyd.conf
honeyd[6952]: listening promiscuously on eth0: (arp or ip proto 47 or (udp and src port 67 and dst port 68) or (ip )) and not ether src 98:4b:e1:94:62:46
honeyd[6952]: [eth0] trying DHCP
honeyd[6952]: Demoting process privileges to uid 65534, gid 65534
honeyd[6952]: [eth0] got DHCP offer: 192.168.23.3
honeyd[6952]: Updating ARP binding: 00:00:24:8b:83:c3 -> 192.168.23.3
honeyd[6952]: arp reply 192.168.23.3 is-at 00:00:24:8b:83:c3
honeyd[6952]: Sending ICMP Echo Reply: 192.168.23.3 -> 110.44.116.18

after some research, i came to know that i should include "-l" to create logs.
but it showed me only this.

root@kali:/etc/honeypot# honeyd -l -d -f honeyd.conf
Honeyd V1.5c Copyright (c) 2002-2007 Niels Provos
honeyd[6960]: started with -l -d -f honeyd.conf
honeyd[6960]: listening promiscuously on eth0: (arp or ip proto 47 or (udp and src port 67 and dst port 68) or (ip )) and not ether src 98:4b:e1:94:62:46
honeyd[6960]: [eth0] trying DHCP
Honeyd starting as background process
root@kali:/etc/honeypot#

so what could be the issue? Urgent help needed.
thanks in advance
P.S I am a linux newbie.

Restrictive Iptables Rule For DHCP

I was reading the frozentux appendix for dhcp (https://www.frozentux.net/iptables-t...tml/x6316.html) and I was wondering how could this Code:
$IPTABLES  -I INPUT -i $LAN_IFACE -p udp --dport 67:68 --sport 67:68 -j ACCEPT

be made to be more restrictive? The author himself says that this ca be done, but doesn't give any details in this respect.

I am interested in both cases - if the computer is a dhcp server or if it is only a dhcp client. Can you help me out with this?

Honeyd Error While Running With Honeyd.conf In Kali Linux

hi there once again
Now I am getting this problem which running the cmd "honeyd -d -f honeyd.conf"
root@kali:/etc/honeypot# honeyd -d -f honeyd.conf
Honeyd V1.5c Copyright (c) 2002-2007 Niels Provos
honeyd[4726]: started with -d -f honeyd.conf
honeyd[4726]: listening promiscuously on eth0: (arp or ip proto 47 or (udp and src port 67 and dst port 68) or (ip )) and not ether src 98:4b:e1:94:62:46
honeyd[4726]: [eth0] trying DHCP
honeyd[4726]: Demoting process privileges to uid 65534, gid 65534
honeyd[4726]: [eth0] got DHCP offer: 192.168.23.2
honeyd[4726]: Updating ARP binding: 00:00:24:26:26:1d -> 192.168.23.2
honeyd[4726]: arp reply 192.168.23.2 is-at 00:00:24:26:26:1d
honeyd[4726]: TTL exceeded for dst 224.0.0.22 at gw 10.0.0.1
honeyd[4726]: No reverse routing map for 10.0.0.1
honeyd[4726]: TTL exceeded for dst 224.0.0.22 at gw 10.0.0.1
honeyd[4726]: No reverse routing map for 10.0.0.1
honeyd[4726]: TTL exceeded for dst 224.0.0.22 at gw 10.0.0.1
honeyd[4726]: No reverse routing map for 10.0.0.1
honeyd[4726]: TTL exceeded for dst 224.0.0.22 at gw 10.0.0.1
honeyd[4726]: No reverse routing map for 10.0.0.1

what does it mean? because it starts to spam the terminal with such errors. or it is not??

I think, I have to edit the "honeyd.conf" file, but no clue.
the following is my honeyd configuration.

route entry 10.0.0.1
route 10.0.0.1 link 10.2.0.0/24
route 10.0.0.1 add net 10.3.0.0/16 10.3.0.1 latency 8ms bandwidth 10Mbps
route 10.3.0.1 link 10.3.0.0/24
route 10.3.0.1 add net 10.3.1.0/24 10.3.1.1 latency 7ms loss 0.5
route 10.3.1.1 link 10.3.1.0/24

# Example of a simple host template and its binding
create template
set template personality "Microsoft Windows XP Professional SP1"
set template uptime 1728650
set template maxfds 35
# For a complex IIS server
add template tcp port 80 "sh /usr/share/honeyd/scripts/win32/web.sh"
add template tcp port 22 "/usr/share/honeyd/scripts/test.sh $ipsrc $dport"
add template tcp port 23 proxy $ipsrc:23
add template udp port 53 proxy 141.211.92.141:53
set template default tcp action reset
# Use this if you are not running honeyd as 'honeyd' user:
# Debian-specific (use nobody = 65534 instead of 32767)
# set template uid 65534 gid 65534

create default
set default default tcp action block
set default default udp action block
set default default icmp action block

create windows
set windows personality "Microsoft Windows XP Professional SP1"
set windows default tcp action reset
add windows tcp port 135 open
add windows tcp port 139 open
add windows tcp port 445 open

set windows ethernet "00:00:24:ab:8c:12"
dhcp windows on eth0


urgent help needed please. thanks in advance

Not Authoritative For Subnet 192.168.2.0 ??

Why is this log Code:
not authoritative for subnet 192.168.2.0

in /var/log/messages ,rejecting the connection ???