
The simplest one is DHCP: the system looks for a DHCP server and configures the
interface.
.P
If you want to specify the IP address exactly, use the same syntax as before:
.Dx

.De

****

device.  You may see something like this on the console:
.Dx
Manufacturer ID: 01015751
Product version: 5.0
Product name: 3Com Corporation | 3CCFE575BT | LAN Cardbus Card | 001 | 
Functions: Network Adaptor, Memory
CIS reading done
cardbus0: Resource not specified in CIS: id=14, size=80
cardbus0: Resource not specified in CIS: id=18, size=80
xl0: <3Com 3c575B Fast Etherlink XL> port 0x1080-0x10bf mem 0x88002400-0x8800247
f,0x88002480-0x880024ff irq 11 at device 0.0 on cardbus0
xl0: Ethernet address: 00:10:4b:f8:fd:20
miibus0: <MII bus> on xl0
tdkphy0: <TDK 78Q2120 media interface> on miibus0
tdkphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
.De
As we saw in
.Sref "\*[chconfigfiles]" ,
page
.Sref \*[PCMCIA-details] ,
there are some special considerations when handling PC Card network cards.  If
your configuration files are correct, you should see the card in the
.Command ifconfig
output after it has been detected.  For example, after inserting a conventional
Ethernet card in your machine, you might see:
.Dx
Apr 27 17:36:28 andante /kernel: pccard: card inserted, slot 0
Apr 27 17:36:34 andante pccardd[59]: Card "3Com Corporation"("3C589D") [TP
/BNC LAN Card Ver. 2a] [000002] matched "3Com Corporation" ("3C589") [(nul
l)] [(null)] 
Apr 27 17:36:39 andante /kernel: ep0: <3Com Etherlink III 3C589> at port 0
x280-0x28f irq 11 slot 0 on pccard0
Apr 27 17:36:39 andante /kernel: ep0: Ethernet address 00:60:97:88:e7:93
Apr 27 17:36:39 andante pccardd[59]: ep0: 3Com Corporation (3C589) inserted.
.De
At this point, 
.Command ifconfig
tells you:
.Dx
# \f(CBifconfig ep0\fP
ep0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:60:97:88:e7:93 
        media: Ethernet 10baseT/UTP
.De
In this respect, it's no different from any other Ethernet board.  You can use
.Command ifconfig
to configure it in exactly the same way as described above for normal Ethernet
boards.  What you can't do is to start it from the configuration files in the
same way you do for other Ethernet cards: when the configuration files run, the
device doesn't exist.  Instead, the system startup files provide a way to handle
a single PC Card device: you set the variable \f(CWpccard_ifconfig\fP in
.File /etc/rc.conf .
For example, you might set it to one of these values:
.Dx
pccard_ifconfig=DHCP                                      \fIfor DHCP config\fP\|
pccard_ifconfig="223.147.37.199 netmask 255.255.255.192"  \fIfor manual config\fP\|
.De
The file 
.File /etc/pccard_ether
uses this variable to assign the addresses.  It also uses the variables
\f(CWdefaultrouter\fP and \f(CWstatic_routes\fP.  In most cases, this is
sufficient.  If you plan to run more than one network card in your laptop (for
example a wired Ethernet and a wireless card), the DHCP alternative won't work,
since at present
.Command dhclient
supports only one interface.  The second alternative will try to assign the same
address to both interfaces, almost certainly not what you want.
.P
One solution is to put the configuration in the 
.File /etc/pccard.conf
file.  First, look for the card definition in
.File /etc/defaults/pccard.conf .
We know the CIS information from the log output above: it's \f(CW3Com\
Corporation\fP and \f(CW3C589\fP.  In
.File /etc/defaults/pccard.conf
we find:
.Dx
# 3Com Etherlink III 3C589B, 3C589C
card "3Com Corporation" "3C589"
        config  0x1 "ep" ?
        insert  /etc/pccard_ether $device -link0 link1
        remove  /sbin/ifconfig $device delete
.De
Copy this entry to 
.File /etc/pccard.conf
and add additional configuration
information.  For example, if you want to use DHCP to configure the system (a
fairly normal thing to do with laptops), you would add:
.Dx
# 3Com Etherlink III 3C589B, 3C589C
card "3Com Corporation" "3C589"
        config  0x1 "ep" ?
        \f(CBinsert  ifconfig $device -link0 link1\fP
        \f(CBinsert  dhclient $device\fP
        \f(CBinsert  route delete default\fP
        \f(CBinsert  route add default 223.147.37.5\fP
        remove  /sbin/ifconfig $device delete
        \f(CBremove  killall dhclient\fP
.De
We delete the default route before adding it in case it was already assigned.
It's unlikely that this is the best choice; it's simply an example of what you
might choose to do.  It's currently necessary to stop 
.Command dhclient
when you remove a card, so we add a second \f(CWremove\fP entry to do so.
.P
Assuming that this code were in place in the previous example, the console
output might continue with this:
.Dx
Apr 27 16:36:39 andante dhclient: New IP Address(ep0): 223.147.37.199
Apr 27 16:36:39 andante dhclient: New Subnet Mask (ep0): 255.255.255.224
Apr 27 16:36:39 andante dhclient: New Broadcast Address(ep0): 223.147.37.
223
Apr 27 16:36:39 andante dhclient: New Routers: 223.147.37.222
.De
See
.Sref "\*[chnetsetup]" ,
page
.Sref \*[DHCP] , 
for more details on DHCP.
