1

I constructed dhcp server on centOS6 (which has a ipaddress 192.168.0.0) to allocate ip address, 192.168.0.5, to other local node.

When i use "service network restart" on client node and type ifconfig, the client node show their allocated ip (192.168.0.5) and subnetmask (255.255.255.0)

However When i try to access dhcp server from client node using ssh (hostname)@192.168.0.5, the terminal just show "ssh: connect to host 192.168.0.0 port 22: Network is unreachable".

what's wrong with my concept? I can't even guess. Below are my configuration files.

/etc/sysconfig/network-script/ifcfg-eth0 on server

TYPE="Ethernet"
BOOTPROTO=static
NAME="eth0"
UUID=(UUID on server)
ONBOOT="yes"
IPADDR0=192.168.0.0
NETMASK=255.255.255.0
HWADDR=(MAC address  on server)

/etc/sysconfig/network-script/ifcfg-eth0 on client

TYPE="Ethernet"
BOOTPROTO=dhcp
NAME="eth0"
UUID=(UUID on client ethernet)
ONBOOT="yes"
HWADDR=(MAC address on client ethernet)

/etc/dhcp/dhcpd.conf

subnet 192.168.0.0 netmask 255.255.255.0 {

    host node2 {
        hardware ethernet (Mac address on client ethernet);
        fixed-address 192.168.0.5;
    }

}
MadHatter
  • 78,442
  • 20
  • 178
  • 229
duckdeok
  • 21
  • 1
  • 7
  • 3
    your ip isn't valid in your netmask http://serverfault.com/questions/10985/is-x-y-z-0-a-valid-ip-address – Froggiz Aug 31 '15 at 15:26
  • Whatever this is a problem with, it's **not** DHCP, because you've confirmed that the client has the right address. Might the client be running a firewall (`iptables -L -n -v` on the client)? Is the client running `sshd`? Might `/etc/hosts.{allow,deny}` be causing problems? We can't know. But we can be fairly sure it's **not** dhcpd. – MadHatter Aug 31 '15 at 15:27

1 Answers1

2

You can't use 192.168.0.0 as the IP address on the router / DHCP server.

With a /24 subnet (netmask 255.255.255.0) the first usable IP address is 192.168.0.1.

For more information as to why see this previous Q&A.

Gene
  • 3,633
  • 19
  • 39