0

I'd configure isc-dhcp-server and its works fine but now we are running out of range as we are exceed 255+ active devices.

Current configuration:

eth0: 192.168.0.1

I want to setup following things.

eth0: 192.168.0.1 Only for lan devices eth1: 192.168.1.1 Only for wifi routers and wifi devices.

Now my question is how to configure dhcp server so for the dhcp request comes on eth0 port its serve 192.168.0.X ip range and for wireless request comes at eth1 serves 192.168.1.x ip range

2 Answers 2

2

First select Interface card

sudo nano /etc/default/isc-dhcp-server

# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid

# Additional options to start dhcpd with.
#   Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

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

Configure Subnet

sudo nano /etc/dhcp/dhcpd.conf

comment all and above put this

subnet 192.168.0.0 netmask 255.255.255.0 {
       range 192.168.0.xxx 192.168.0.xxx;
        option routers                  192.168.0.x;
        option subnet-mask              255.255.255.0;
        option broadcast-address        192.168.0.255;
        option domain-name-servers      xxx.xxx.xxx.xxx;
        default-lease-time 86400;
        max-lease-time 86400;


}

subnet  192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.xxx 192.168.1.xxx;
        option routers                  192.168.1.x;
        option subnet-mask              255.255.255.0;
        option broadcast-address        192.168.1.255;
        option domain-name-servers      xxx.xxx.xxx.xxx;
        default-lease-time 86400;
        max-lease-time 86400;

}

Restart service

sudo service isc-dhcp-server restart

Try?

2
  • One more question as eth1 192.168.1.0 which is will be connected to wifi router so when some one try to connect wifi router how it will get 192.168.1.X ip address ? When people connect using lan its request comes to eth0 192.168.0.1 and its get 192.168.0.X ip address and when people connect from wifi its request comes to eth1 192.168.1.0 and people get 192.168.1.X ip address I don't understand how dhcp do that Mar 27, 2015 at 8:38
  • 1
    Connect wifi ruter from lan port to dhcp server eth1, no wan. Wifi router will relay dhcp request to server and that will work. Dhcp serevr offer ip based from ip on witch interface request come. Eth0 ip is 192.168.0.x and if request come on that port server looks on config and offer that range of ip addresses.
    – 2707974
    Mar 27, 2015 at 8:54
1

To get distinct subnet ip addresses for your wifi devices from your lan devices, if you have multiple wifi routers you should connect them to seperate hub or switch connecting it to one of interfaces of your DHCP server say eth1

Other interface say eth0 will be connected to the switch which is having all lan device connected to it.

Now Lets start with configuration,

When a DHCP configured PC boots, it requests its IP address from the DHCP server. It does this by sending a standardized DHCP broadcast request packet to the DHCP server with a source IP address of 255.255.255.255.

If your DHCP server has more than one interface, you have to add a route for this 255.255.255.255 address so that it knows the interface on which to send the reply; if not, it sends it to the default gateway.

Add the route to your /etc/network/interfaces file. In this case the route is added to the eth0 interface.

#
# File: /etc/network/interfaces
#

iface eth0 inet static

       address 192.168.0.1
       netmask 255.255.255.0
       up route add -host 255.255.255.255 eth0

iface eth1 inet static

       address 192.168.1.0
       netmask 255.255.255.0
       up route add -host 255.255.255.255 eth1

Now, You can configure your DHCP configuration as given by @2707974

Suppose request comes to say eth0, which is configured with address with subnet 192.168.0.X so that client will get ip in 192.168.0.X range.

Similarly, for eth1 interface.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .