|
Lines 2626-2654
Link Here
|
| 2626 |
execute dhclient, and if successful, will fill in the network |
2626 |
execute dhclient, and if successful, will fill in the network |
| 2627 |
configuration information automatically.</para> |
2627 |
configuration information automatically.</para> |
| 2628 |
|
2628 |
|
| 2629 |
<para>To have your system use DHCP to obtain network information |
2629 |
<para>There are two things you must do to have your system use |
| 2630 |
upon startup, edit your <filename>/etc/rc.conf</filename> to |
2630 |
DHCP upon startup:</para> |
| 2631 |
include the following:</para> |
2631 |
|
|
|
2632 |
<itemizedlist> |
| 2633 |
<listitem> |
| 2634 |
<para>Make sure that the <devicename>bpf</devicename> |
| 2635 |
device is compiled into your kernel. To do this, add |
| 2636 |
<quote>psuedo-device bpf</quote> to your kernel |
| 2637 |
configuration file, and rebuild the kernel. For more |
| 2638 |
information about building kernels, see <xref |
| 2639 |
linkend="kernelconfig">.</para> |
| 2640 |
<para>The <devicename>bpf</devicename> device is already |
| 2641 |
part of the <emphasis>GENERIC</emphasis> kernel that is |
| 2642 |
supplied with FreeBSD, so if you don't have a custom |
| 2643 |
kernel, you shouldn't need to create one in order to get |
| 2644 |
DHCP working.</para> |
| 2645 |
<note> |
| 2646 |
<para>For those who are particularly security conscious, |
| 2647 |
you should be warned that <devicename>bpf</devicename> |
| 2648 |
is also the device that allows packet sniffers to work |
| 2649 |
correctly (although they still have to be run as |
| 2650 |
root). <devicename>bpf</devicename> |
| 2651 |
<emphasis>is</emphasis> required to use DHCP, but if |
| 2652 |
you are very sensitive about security, you probably |
| 2653 |
shouldn't add <devicename>bpf</devicename> to your |
| 2654 |
kernel in the expectation that at some point in the |
| 2655 |
future you will be using DHCP.</para> |
| 2656 |
</note> |
| 2657 |
</listitem> |
| 2658 |
<listitem> |
| 2659 |
<para>Edit your <filename>/etc/rc.conf</filename> to |
| 2660 |
include the following:</para> |
| 2632 |
|
2661 |
|
| 2633 |
<programlisting> |
2662 |
<programlisting> |
| 2634 |
ifconfig_fxp0="DHCP" |
2663 |
ifconfig_fxp0="DHCP" |
| 2635 |
</programlisting> |
2664 |
</programlisting> |
| 2636 |
|
2665 |
|
| 2637 |
<note> |
2666 |
<note> |
| 2638 |
<para>Be sure to replace <literal>fxp0</literal> with the |
2667 |
<para>Be sure to replace <literal>fxp0</literal> with the |
| 2639 |
designation for the interface that you wish to dynamically |
2668 |
designation for the interface that you wish to dynamically |
| 2640 |
configure.</para> |
2669 |
configure.</para> |
| 2641 |
</note> |
2670 |
</note> |
| 2642 |
|
2671 |
|
| 2643 |
<para>If you are using a different location for |
2672 |
<para>If you are using a different location for |
| 2644 |
<command>dhclient</command>, or if you wish to pass additional |
2673 |
<command>dhclient</command>, or if you wish to pass additional |
| 2645 |
flags to <command>dhclient</command>, also include the |
2674 |
flags to <command>dhclient</command>, also include the |
| 2646 |
following (editing as necessary):</para> |
2675 |
following (editing as necessary):</para> |
| 2647 |
|
2676 |
|
| 2648 |
<programlisting> |
2677 |
<programlisting> |
| 2649 |
dhcp_program="/sbin/dhclient" |
2678 |
dhcp_program="/sbin/dhclient" |
| 2650 |
dhcp_flags="" |
2679 |
dhcp_flags="" |
| 2651 |
</programlisting> |
2680 |
</programlisting> |
|
|
2681 |
</listitem> |
| 2682 |
</itemizedlist> |
| 2652 |
|
2683 |
|
| 2653 |
<para>The DHCP server, <command>dhcpd</command>, is included |
2684 |
<para>The DHCP server, <command>dhcpd</command>, is included |
| 2654 |
as part of the <literal>isc-dhcp2</literal> port in the ports |
2685 |
as part of the <literal>isc-dhcp2</literal> port in the ports |