I noticed recently that my internet router (a Fritzbox) wasn't recording my machines' hostname, and all were showing up as "noname".
This makes communicating with the BSD computer from other machines on the LAN impossible.
The following will probably help with many internet routers that provide DHCP.
1. First you need to know the network card type and MAC address. From a console, type
and you'll get back something like:
|
Quote:
|
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet6 fe80::250:bfff:fee7:27ea%rl0 prefixlen 64 scopeid 0x1
inet 192.168.178.40 netmask 0xffffff00 broadcast 192.168.178.255
ether 00:50:bf:e7:de:ad
media: Ethernet autoselect (10baseT/UTP)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
pfsync0: flags=0<> mtu 2020
pflog0: flags=0<> mtu 33208
|
The first item with 2 letters and a number (often zero) is your
network card id, which in my example is a realtek card (ignore lo0, this is the local loopback device present on every machine) and the 6 pairs of hexadecimal after ether is the
card's MAC address.
2. Next, edit /etc/dhclient.conf as root.
|
Code:
|
su
Password:
ee /etc/dhclient.conf |
Add the following to the file (which by default is empty), substituting your card type and MAC address:
|
Quote:
|
interface "rl0" {
send host-name "mymachinename";
send dhcp-client-identifier 1:00:50:bf:e7:de:ad;
}
|
and save.
3. To bring this into effect without rebooting, as the superuser:
|
Quote:
|
ifconfig rl0 down
ifconfig rl0 up
|
( :idea: Maybe future version of PCBSD will automatically create the dhclient.conf file during installation if the user specifies the interface as DHCP under advanced options )