Adding a second network card (and compiling a kernel)My FreeBSD box will act as a gateway. It will do this using two network cards. One card (ed0) will talk to the outside world. The other card (ed1) will talk to my subnet..
The system needs to know about the new device. There are two steps this this.
- add the interface to the list
- create a new kernel
Add the interface to the listIn /etc/rc.conf, you need to add the new device to the list of network interfaces. You will need an entry similar to the following:
network_interfaces="ed0 ed1 lo0"
Create a new kernelFor instructions on how to create a new kernel, refer to Configuring the FreeBSD Kernel section in the FreeBSD handbook. Pay special attention to the section on Building and Installing a Custom Kernel.
Don’t forget to create a device for your new NIC. In my case, I’m adding a second NE2000 card to create ed1. Here’s what I made sure the kernel contained:
device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr device ed1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector edintr
You will need to add a similar entry according to the type of device you are adding. Remember to set the IRQ and IOMEM settings correctly. The above settings are based on the settings on your physical network card. Many cards come with a floppy disk which allows you to set the values. Others are Plug and Play. I’m sorry, but I don’t have more information on card settings.