Thursday, September 10, 2015

Linux DHCP Server - Interface Association




I have a question about the dhcp server on linux



Basically my server has 2 interface cards




  • eth0 : 192.168.2.201/255.255.255.0

  • eth1 : 192.168.4.1/255.255.255.0

  • eth1:0 : 10.1.1.0/24




On this server i am running the dhcpd daemon to hand out leases in the 192.168.4.0/24 subnet.




  • eth0 : connected to my home router to access internet

  • eth1 : connected to a cisco switch (with only default vlan) on port 1 with ip address 10.1.1.10 - this interface is used for communication with the switch for management through telnet



Now when i plug in another computer on any port on the switch i see the following





  • the computer gets 169.254 self assigned ip

  • i see the DHCP server did hand out a lease (/var/lib/dhcpd/dhcpd.leases file)

  • under ethernet status on the client computer i see bytes sent but 0 received



Now my question is



To which interface on the linux server does the dhcpd daemon bound to ? Since i see the lease being assigned it is obviously getting the dhcp request yet the lease it sends out is not reaching the client.



Any help would be much appreciated !




thank you,
ankit


Answer



You can't use 10.1.1.0 as the IP of the NIC, that's a network ID. DHCPd should bind to all interfaces that it has subnet definitions for. So if it has only definitions for the 192.168.4/24 subnet, then it should only bind to eth1. What's the output from DHCPd when it starts? It should mention what interfaces it's listening on.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...