Installing via wireless NIC
If you have been paying attention and reading every one of my articles (which of course, everyone does, I have no doubt)
you will recall that John Van Boxtel gave me a Compaq Presario 1620 laptop. This beast has an 814MB disk, 48MB of RAM,
and three spare batteries. I’ve also been given two Lucent Orinoco wireless cards, one Gold, and one Silver. Over the
weekend, I’ve managed to combine the two donations and get FreeBSD installed on the laptop using wireless. Also critical
to this success is David Yeske who sent me an mfsroot.flp image which contained wicontrol. Without that,
installing via wireless would not have worked for me. David plans to incorporate this into the install process for FreeBSD
so that wireless installs are just another install option!
What I did
I installed a wireless NIC into my desktop, configured it to act as a gateway, enabled NAT, and used that as the
gateway for my laptop. The laptop then communicated with the gateway using its own wireless NIC. Together, these two
boxes allowed me to do an install on the laptop using wireless. This was after I’d failed using the laptop’s CD, which I
now know is broken.
This article will not go into detail concerning gateway creation, NAT, or the install process. There are other articles which
cover this information and are more appropriate to those task. Please refer to the Topics for
help in those areas.
Configuring the desktop
My boxes have hardcoded IP addresses. I’m not using DHCP. So I added the following entries to /etc/rc.conf on my
desktop box:
pccard_enable="YES" # Set to YES if you want to configure PCCARD devices.
pccard_mem="0xd8000"
pccard_ifconfig="inet 10.0.0.2 netmask 255.255.255.0"
The entries on my laptop were created by the install process. I didn’t have to create them. But I’ll show you what they are
in the Laptop Install section
The main things you must remember to do on the desktop is to configure it as a gateway and to enable NAT. Because my
desktop box was already configured with ipfilter, all I had to do was this:
- Tell the box it’s a gateway by adding this to /etc/rc.conf:
gateway_enable="YES"
To invoke the gateway without rebooting, I issued this command:
sysctl -w net.inet.ip.forwarding=1
-
Create the NAT rules. I added this to /etc/ipnat.conf
[Note that rl0 is the external NIC. Addresses which reach it and are in the range
10.0.0.0/16 will be translated to 0.0.0.0/32 (which is whatever IP address is on rl0)]:map rl0 10.0.0.0/16 -> 0.0.0.0/32 portmap tcp/udp 40000:65000 map rl0 10.0.0.0/16 -> 0.0.0.0/32
-
Enable NAT. I added these entries to /etc/rc.conf:
ipfilter_enable="YES" # Set to YES to enable ipfilter functionality ipnat_enable="YES" # Set to YES for ipnat; needs ipfilter, too!
To invoke the NAT without rebooting, I issued this command:
ipnat -f /etc/ipnat.conf
Creating Peer-to-Peer cards
The two wireless cards are Orinoco cards from Lucent Technologies. One is a
Gold card, the other is a
Silver card. The primary difference between the two is the
level of encryption available. They just plug into a PCMCIA slot on your laptop or into an adaptor in your desktop. I was
given both an ISA adaptor and a PCI adaptor. I have yet to get the PCI adaptor to work, but the ISA adaptor works fine.
I hear work is underway to get the PCI adaptor working.
These cards appears as a wi device. And
the key to getting the two wireless cards talking to each other is the port type. The cards (I’m going to start
calling them NICs any moment now) can talk to either an access point or another card. In ad-hoc mode, any card to
speak to any
other card which is also in ad-hoc mode. In BSS mode, a card can only talk to an access point. Since I have only
two cards and no access point, I’ll be putting both cards into ad-hoc mode. The cards can be put into ad-hoc mode
with the following command:
wicontrol -i wi0 -p 3
Please refer to man wicontrol for more detail.
/etc/pccard.conf
The following is from man pccard.conf:
The pccard.conf file is the configuration file for the pccardd(8) PC-CARD slot management daemon. It provides information to allow card identifi- cation, and the matching of drivers (along with driver resources) to the PC-CARD cards.
In short, it allows the card to be connected to a driver when the card is inserted into the laptop.
The default values for the cards are located in /etc/defaults/pccard.conf.
Here is the entry I’ve created in /etc/pccard.conf based on the defaults. I found this
entry by searching for “Lucent WaveLAN” and picking the one which applied to device wi:
$ more /etc/pccard.conf # Lucent WaveLAN/IEEE card "Lucent Technologies" "WaveLAN/IEEE" config 0x1 "wi" 5 # config auto "wi" 11 insert /etc/pccard_ether $device start remove /etc/pccard_ether $device stop insert wicontrol -i $device -p 3
Note the last line. I added this line to force the device into ad-hoc mode. This command will be executed
each time the card is inserted (or when the laptop is booted and the card is already inserted).
Note that $device is a placeholder for the actual device name, in this case wi0.
If you are using DHCP, there is a better solution. The above will work with DHCP, but this following method
is cleaner. Gregory Shapiro said:
The hook is to create /etc/dhclient-exit-hooks (chmod 0755) with:
# Initialize the WaveLAN card with the proper parameters if [ "$interface" = "wi0" -a "$reason" = "PREINIT" ] then /usr/sbin/wicontrol -i $interface -P 3 fi exit 0
The laptop install
The main problem with the install now is that it doesn’t use the PCCARD. You need to do something extra. Namely setup the
card so it works. The existing install does attempt to use the card, but it doesn’t go all the way. I managed, mostly by
luck, to locate David Yeske who was planning to solve this very problem. I volunteered to test what he was working on.
A couple of days later, David sent me an email directing me to his website where I found a new mfsroot.flp image.
This is used on the second of the two install disks.
Within this image was included wicontrol, which is what
I needed in order to get the laptop wireless card functioning. I just used David’s version of the image for my
install disks. You can find David’s files in
the sample files directory. They were created for 4.4-RELEASE.
Here’s an overview of the install process. This should be enough to let you know how to proceed:
- During the install process, right after probing devices, you will be asked:
Found PC-card slots(s), Use PC-card device as installation media?
I selected yes. Then I selected the default free-address
area (0xd0009) and IRQ 3. The install then goes into initialization mode. The
box beeps, and the light comes on the wireless card.To figure out what IRQ to use, I wrote the options on paper, then looked
at the results of the probing. I pressed scroll lock and used page-
up/page-down to look at the IRQs which were found. I crossed off any
which I saw and then tried the ones which were unused. I used IRQ 3
which seemed to work fine. -
When I get to the /stand/sysinstall Main Menu, I went to the Fixit menu
item and I started the emergency holographic shell. Then ALT-F4 to get
into it, then:wicontrol -i wi0 -p 3
I get a solid green light on the laptop card
Then I did:
ifconfig wi0 10.0.0.10 netmask 255.255.255.0
From my desktop with the wireless NIC, I tried a ping 10.0.0.10 to
confirm that communication between the two wireless NICs
was working:# ping 10.0.0.10 PING 10.0.0.10 (10.0.0.10): 56 data bytes 64 bytes from 10.0.0.10: icmp_seq=0 ttl=255 time=2.090 ms 64 bytes from 10.0.0.10: icmp_seq=1 ttl=255 time=2.063 ms 64 bytes from 10.0.0.10: icmp_seq=2 ttl=255 time=2.029 ms 64 bytes from 10.0.0.10: icmp_seq=3 ttl=255 time=2.021 ms 64 bytes from 10.0.0.10: icmp_seq=4 ttl=255 time=2.026 ms 64 bytes from 10.0.0.10: icmp_seq=5 ttl=255 time=2.033 ms ^C --- 10.0.0.10 ping statistics --- 6 packets transmitted, 6 packets received, 0% packet loss round-trip min/avg/max/stddev = 2.021/2.044/2.090/0.025 ms
- I pressed ALT-F1 and went back to the install where
I did a custom install.
After that, the install just worked…. It was great!
Here are the /etc/rc.conf entries from the laptop:
pccard_enable="YES" pccard_ifconfig="inet 10.0.0.10 netmask 255.255.255.0" pccard_mem="DEFAULT" pccardd_flags=" -i 3"
thanks to…
I’d like to thank the following people:
- Matthew Turany for providing the WaveLAN cards.
- John Van Boxtel for providing the laptop.
- David Yeske for the disk images containing wicontrol.
- Jim Mock for suggesting wicontrol -i wd0 -p 3.
- Gregory Shapiro for the /etc/pccard.conf tip.
Do not forget to put this options in your FreeBSD router!
device pcic0
device pcic1
device card
With this options the pci converter works fine.
Henk
What version of FreeBSD are those for? I’ve been speaking with the pccard developer about this. At the time, it wasn’t possible, AFAIK.
Does anyone have any information with setting up desktops for wireless? How about with Ambicon (www.ambicon.com) ieee 802.11b?
Thanx for any help!
Travis
Yeah, tons of nice ones for OpenBSD and FreeBSD!
Hi.
I’m trying to put 2 pccards (orinoco wavelan) on my desktop, using PCMCIA->ISA adapter.
FreeBSD 4.11 stable insists in cosider the second card in "slot0", ie
every time I insert a card in, it says: "pccard inserted in slot0"
so wi1 never is configured.
#***************************
# PCCARD.CONF
#***************************
# Generally available IO ports
io 0x240-0x360
# Generally available IRQs (Built-in sound-card owners remove 5)
irq 3 4 7 10 11 13 15
# Available memory slots
memory 0xd0000 96k
memory 0xd4000 96k
# Lucent WaveLAN/IEEE
card "Lucent Technologies" "WaveLAN/IEEE"
config auto "wi0"
config auto "wi1"
insert /etc/pccard_ether_wi0
insert /etc/pccard_ether_wi1
remove /sbin/ifconfig wi0 delete
remove /sbin/ifconfig wi1 delete
#***************************
#***************************
# /etc/pccard_ether_wi0
#***************************
wicontrol -i wi0 -p 1
wicontrol -i wi0 -c 1
wicontrol -i wi0 -n server
wicontrol -i wi0 -s router1
wicontrol -i wi0 -t 1
wicontrol -i wi0 -f 1
#***************************
# /etc/pccard_ether_wi1
#***************************
wicontrol -i wi1 -p 1
wicontrol -i wi1 -n internal-net
wicontrol -i wi1 -s int-net
wicontrol -i wi1 -t 3
Someone have some "tip" for me?
thank you in advance
FMS
hi,
we are trying to get a Lucent Orinoco 11 Mbps Wireless
card up and running in a PCI slot on a m/c running freeBSD.
The card is working fine since I tested it on a Laptop running
Windows ME , but I am unable to check it on the BSD machine.
What is the problem ??
Please let me know.
thanks
vishal
Try moving it to another PCI slot.
It’s a FreeBSD problem, just like Dan says himself in his own article.
I had the same issue, so then tried it on OpenBSD and works flawlessly! But of course, that’s OpenBSD for you.. OpenBSD is just better most of the time with new hardware, etc.
I’m now gonna setup OpenBSD as an IPSec based WAP, NAT Router, Transparent IPSec Bridge, yadda yadda yadda… screw WEP! Not secure enough for me.
Just hopefully I’ll be able to get 5-6 NICs working in this box without too many IRQ conflicts.
I just confirmed, it’s for sure not yet supported in FreeBSD for PCI bridges, only the ISA ones… Might wanna go OpenBSD in the meanwhile if you really need it.
i have heard that if u run atleast freebsd 4.4 stable there is a good chance ur pci cards will work.how much truth is there in this?
Vinod
I succesfully installed FreeBSD4.4 from scratch using Netgear 301/401 PCI/PC-Card-Adapter / Wireless Card on a P133MHz-system. The installers recognized the card right away.
what i didn’t get online yet is an old 8MB/386 Laptop (Toshiba T2400CS) with PCMCIA-Slot. the "normal" install-floppys don’t get it and the "wireless" extra rootfs.flp even crashes…
Some PCI/PC-Card adapters will only work if PCI 2.2 is supported on the motherboard. Some reported that the Orinoco PCI adapter (aka SCM SwapBox) is such a card.
The Orinoco PCI adapter I recently bought works flawlessly on an older PCI 2.1 motherboard (Intel 430TX PCIset) though. Obviously there are different versions of this card.
In any case, you may want to check whether your problems relate to PCI troubles.
–florian
Same problem with e-mobility Nortel Networks card with PCI adapter on a freeBSD 4.6 station.
I added the card in the pci_ids[] array of /usr/src/sys/dev/wi/if_wi_pci.c and rebuilded the kernel.
dmesg result is :
wi0:<e-mobility Nortel Networks> port oxd ….
wi0:wi_pci_attach()failed to enable pci !
device probe_and_attach:wi attach returned 6
and pciconf -l result :
…
none@pci1:13:0 …..
Any idea for my card ?
Regards,
(posted by Dan Langille)
You mentioned that you are having trouble getting the PCMCIA->PCI adapter for your Orinoco cards working. This is probably due to the fact that they are PCI 2.2 (PC99) compliant ONLY. This means that it only works in PC’s that have PCI 2.2 spec’d slots, usually only MoBos with no ISA meet this spec.
>From the Orinoco/Wavelan/Agere Systems site:
"The ORiNOCO PCI adapter is ideal for PC99 compliant PCs
(PCI slots only machines) or PCs that have BIOS
supporting PCI 2.2 or higher.
* For PCs with an ISA slot, the ORiNOCO ISA adapter is strongly advised. "
Since only really new MoBos will be compliant, you probably won’t get to use the adapter unless you get a new computer.
I recently bought a Orinoco PCI adapter (actually it is a SCM SwapBox) which requires only PCI 2.1 support and works flawlessly on an older motherboard.
–florian
(posted by Dan Langille)
I would suggest that rather than hacking either dhcp or pccard.conf to
set up the parameters on your wireless card that you simply create
/etc/start_if.wi0 and put this in it:
wicontrol -i ${interface} -s `uname -n | sed ‘s/\..*//’ | tr a-z A-Z`
wicontrol -i ${interface} -p 3
wicontrol -i ${interface} -e 1
wicontrol -i ${interface} -k 0xdeadbeef01
(you should suitably change the argument to -k, and -s if you anticipate
ever putting two cards in one machine).
You want to turn encryption on. Believe that @!#$. Since you have a
silver and gold card, be sure to only use 5 byte keys since your silver
card can’t do the full 13 byte ones.
start_if is nice because nothing apart from creating it needs to be done
to get it to work.
The -s argument is nice to have if you get a base station. The link
diags can distinguish the stations by their ‘name’, which is set by the
-s argument. It may be possible to use this information in ad-hoc,
though I’m not sure.
Hi.
I’m trying to put 2 pccards (orinoco wavelan) on my desktop, using PCMCIA->ISA adapter.
FreeBSD 4.11 stable insists in cosider the second card in "slot0", ie
every time I insert a card in, it says: "pccard inserted in slot0"
so wi1 never is configured.
#***************************
# PCCARD.CONF
#***************************
# Generally available IO ports
io 0x240-0x360
# Generally available IRQs (Built-in sound-card owners remove 5)
irq 3 4 7 10 11 13 15
# Available memory slots
memory 0xd0000 96k
memory 0xd4000 96k
# Lucent WaveLAN/IEEE
card "Lucent Technologies" "WaveLAN/IEEE"
config auto "wi0"
config auto "wi1"
insert /etc/pccard_ether_wi0
insert /etc/pccard_ether_wi1
remove /sbin/ifconfig wi0 delete
remove /sbin/ifconfig wi1 delete
#***************************
#***************************
# /etc/pccard_ether_wi0
#***************************
wicontrol -i wi0 -p 1
wicontrol -i wi0 -c 1
wicontrol -i wi0 -n server
wicontrol -i wi0 -s router1
wicontrol -i wi0 -t 1
wicontrol -i wi0 -f 1
#***************************
# /etc/pccard_ether_wi1
#***************************
wicontrol -i wi1 -p 1
wicontrol -i wi1 -n internal-net
wicontrol -i wi1 -s int-net
wicontrol -i wi1 -t 3
Someone have some "tip" for me?
thank you in advance
FMS
I got it !!!!
#
# [========================================================]
# [ station1 (10.0.0.5-pccard) ]
# [ `-wireless———-> +———————–+ ]
# [ | (10.0.0.5-wi0) | ]
# [ | this machine | ]
# [ | (250.200.150.100-wi1) | ]
# [ <—–wireless—— +———————–+ ]
# [ ISP(250.200.150.254) ]
# [========================================================]
# 1. I’m using 2 adapters PCMCIA->ISA Vadem 469
# 2. The first one has no jumper seted
# 3. The second one, has the first position jumper closed [:] : :
# 4. Reset the machine, press DEL, enter in BIOS
# and RESERV 2 IRQs for LEGACY/ISA !!!
# I used IRQ 3 and 4, and I disabled everything I’ll not use:
# USB, COM1, COM2, PRINTER, INFRARED, etc.
# gateway
defaultrouter="250.200.150.254"
# hostname
hostname="home_fms.myisp.com"
# my ethernet board
ifconfig_rl0="inet 192.168.0.1 netmask 255.255.255.0"
# Wireless
pccard_enable="YES"
pccard_conf="/etc/pccard.conf"
ifconfig_wi0="inet 10.0.0.1 netmask 255.255.255.0"
ifconfig_wi1="inet 250.200.150.100 netmask 255.255.255.0"
natd_enable="YES"
natd_interface="250.200.150.100"
gateway_enable="YES"
router_enable="YES"
router="/sbin/routed"
router_flags="-q"
nfs_reserved_port_only="YES"
sshd_enable="YES"
kern_securelevel_enable="NO"
usbd_enable="NO"
################
# end of rc.conf
################
# Let’s start modifying the kernel-configuration
cd /usr/src/sys/i386/conf
ee mykernel
# 5. Insert this four lines in your kernel-conf:
# PCCARD (PCMCIA) support
device card
device pcic0 at isa? irq 0 port 0x3e0 iomem 0xd0000
device pcic1 at isa? irq 0 port 0x3e2 iomem 0xd4000
# 6. Now you need to recompile the kernel
# ONE TIP: NEVER compile the kernel with the pccards inserted in ISA/PCMCIA boards!!!
config mykernel; cd ../../compile/mykernel; make depend; make; make install; reboot
# 7. I’m using this /etc/pccard.conf:
#####################
# /etc/pccard.conf
#####################
io 0x210-0x360
irq 5 7 10 11
memory 0xd0000 96k
# Lucent WaveLAN/IEEE
card "Lucent Technologies" "WaveLAN/IEEE"
config 0x1 "wi0" ?
insert /etc/pccard_ether wi0 start
insert /etc/pccard_cfgwi0
remove /etc/pccard_ether wi0 stop
config auto "wi1" ?
insert /etc/pccard_ether wi1 start
insert /etc/pccard_cfgwi1
remove /etc/pccard_ether wi1 stop
# Avaya
card "Avaya Communication" "Avaya Wireless PC Card"
config 0x1 "wi0" ?
insert /etc/pccard_ether wi0 start
insert /etc/pccard_cfgwi0
remove /etc/pccard_ether wi0 stop
config auto "wi1" ?
insert /etc/pccard_ether wi1 start
insert /etc/pccard_cfgwi1
remove /etc/pccard_ether wi1 stop
####################
# end of pccard.conf
####################
# 8. Settings for wi0 pccard (it will be used to my internal network)
ee /etc/pccard_cfgwi0
####################
# /etc/pccard_cfgwi0
####################
wi=wi0
wicontrol -i ${wi} -t 3
wicontrol -i ${wi} -n "homenet"
wicontrol -i ${wi} -s mygateway
wicontrol -i ${wi} -p 1
wicontrol -i ${wi} -f 1
# X1y32 is the password for your internal network
# it should have 5 chars (silver pccards)
wicontrol -i ${wi} -k X1y32 -v 1
wicontrol -i ${wi} -T 1
wicontrol -i ${wi} -e 0
wicontrol -i ${wi} -c 1
wicontrol -i ${wi}
ifconfig ${wi}
######################
# end of pccard_cfgwi0
######################
# 9. Settings for wi1 pccard
# (will connect this machine to my ISP)
ee /etc/pccard_cfgwi1
######################
# /etc/pccard_cfgwi1
######################
wi=wi1
wicontrol -i ${wi} -t 3
wicontrol -i ${wi} -n "ISP_wireless_network_name"
wicontrol -i ${wi} -s home_fms
wicontrol -i ${wi} -p 1
wicontrol -i ${wi} -f 1
# 8a23b is the password on the ISP network
# If your ISP do not use passwords, put a ‘#’ at the beggining of next line
wicontrol -i ${wi} -k 8a23b -v 1
wicontrol -i ${wi} -T 1
wicontrol -i ${wi} -e 0
wicontrol -i ${wi} -c 1
wicontrol -i ${wi} | grep -i com
wicontrol -i ${wi}
ifconfig ${wi}
######################
# end of pccard_cfgwi1
######################
# That’s all folks. I hope this can be useful for you.
#
# Tips to remember:
# – reserve IRQS for Legacy/ISA on Bios
# – do not compile kernel with the pccards inserted in
# – be sure to use free IRQs on pccard.conf
# – this should work, if it does not,
# try to put your HD on other machine
# – the second card delays a little to get active when
# you reset, but, don’t worry.
#
# My permanent thanks to: Luis Pfau and Alexandre Brito
##################################################################
fms@hy.com.br
[%sig%]