Tuesday, March 6, 2012

DHCP3 Server Starting in Ubuntu 11.10

1)
apt-get install dhcp3-server
 
2) sudo /etc/init.d/isc-dhcp-server start,It will fail to start first time.
 
Mar  7 16:49:08 ubuntu dhcpd: 
Mar  7 16:49:08 ubuntu dhcpd: 
Mar  7 16:49:08 ubuntu dhcpd: No subnet declaration for eth0 (115.23.194.107).
Mar  7 16:49:08 ubuntu dhcpd: ** Ignoring requests on eth0.  If this is not what
Mar  7 16:49:08 ubuntu dhcpd:    you want, please write a subnet declaration
Mar  7 16:49:08 ubuntu dhcpd:    in your dhcpd.conf file for the network segment
Mar  7 16:49:08 ubuntu dhcpd:    to which interface eth0 is attached. **
Mar  7 16:49:08 ubuntu dhcpd: 
Mar  7 16:49:08 ubuntu dhcpd: 
Mar  7 16:49:08 ubuntu dhcpd: Not configured to listen on any interfaces!
 

3)Errors can be seen in sudo tail /var/log/syslog

4)dhcpcd.conf

# /etc/dhcp/dhcpd.conf
#
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.3 192.168.1.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.2;
option domain-name-servers home;
}
 
5)Add Interface name,my wireless card was wlan0
Edit /etc/default/isc-dhcp-server  
 
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#    Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="wlan1"
 
6)
# location /etc/network/interfaces

auto lo
iface lo inet loopback

auto wlan1
iface wlan1 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
 
 
7)Start dhcp server 3 again
 
sudo ifup wlan1
sudo /etc/init.d/isc-dhcp-server start
 
7)If Interface exists dhcp server will start otherwise you get error again...
 
 

No comments:

Post a Comment