Re: Initializing DHCP-client
Larry Hunsicker wrote:
Another couple of questions, folks:
I have a system with two NICs, one pointing outward to a cable modem
that needs to be set up with DHCP, and one pointing inward to support my
home network that I configure with static IP addresses. I have gotten
and installed dhcp3-client.
How do I get DHCP initialized; i.e., how do I get the dhcp-client files
installed into the init.d and rc*.d files?
If the dhcp-client was installed via apt-get or any of the Debian
installation tools from a Debian package site, then the proper files
will automatically be installed in the proper places for automatic use.
The only thing you have to do is setup your /etc/network/interfaces
file to use it on the proper NIC. You can do this quite easily from an
ncurses-based GUI via the "etherconf" package. Here is an example of my
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
auto lo eth0 eth1
iface lo inet loopback
iface eth0 inet static
iface eth1 inet dhcp
### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.
In this case my eth1 is my "external" interface.
How do I assure that the first NIC is configured by DHCP, but the other
one with static ips?
This depends on several factors. Here is what I do:
1. Make sure your eth0 NIC is first on the PCI bus and your eth1 NIC is
second, if both are PCI cards. The PCI bus assigns IRQs to the cards in
order of their placement on the bus.
2. Place the modules for each NIC in the order you want them
initialized in /etc/modules.
The above gets a bit complicated IF both NICs are the same type/brand,
but the order they appear on the PCI bus "should" separate them. I use
different type NICs that use different driver modules.
An alternative is to "alias" a certain NIC / IRQ combo to the device you
want it to be in /etc/modutils/. Depending on your specific hardware
setup, you might have to use a combination of these techniques.