2

I have two interfaces on a machine running Ubuntu 14.04 LTS. Which has two different interfaces namely eth0 and eth1.

I need to give IP addresses to the clients by the interfaces.

For example,

Any client try to connect by eth0 and needs an IP address, I want to give in range 10.10.0.1 - 10.10.0.100

And the other clients connecting by eth1 should get an IP address in range 10.20.0.1 - 10.20.0.100

Is it possible by writing rules in dhcpd.conf?

1 Answer 1

3

Assuming you are using ISC DHCPd it is based on the subnet:

subnet 10.10.0.0 netmask 255.255.255.0 {
    range 10.10.0.1 10.10.0.100;
}

subnet 10.20.0.0 netmask 255.255.255.0 {
    range 10.20.0.1 10.20.0.100;
}

Your eth0 interface should have an IPv4 address in the 10.10.0.0/24 subnet (I am assuming the subnets are a /24, you didn't mention) and the eth1 interface should have an IPv4 address in the 10.20.0.0/24 subnet.

If you want to limit the interfaces that dhcpd looks at you can put those in /etc/default/isc-dhcp-server.

PS: man dhcpd.conf is your friend.

0

You must log in to answer this question.

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