Currently, my Linux box is connected to a LAN using one of two NICs. This LAN provides DHCP services and allows me to connect to the Internet. I would like to serve DHCP from this same Linux box using the other NIC so I may route between a few embedded devices, but maintain separation from the Internet.

I do not have any experience with routing and ip-tables. Is it possible to coexist as a DHCP client and server on different NICs?


Yes it is possible. This is often done in home network environments where the external card is given an address by the ISP's DHCP server, yet the internal NIC serves DHCP to the home nework. You don't even really need iptables to make this happen. You must be very careful to configure the DHCP server to only serve on the second NIC, but doing that and possibly needing to enable IP forwarding int he kernel (echo 1 > /proc/sys/net/ipv4/ip_forward) are really the only two things you need to worry about to get things working in a very basic way. Other services you may realize you need to make things work well would be some iptables type filtering and DNS services, but those are "work well" as opposed to "work at all" requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.