Home______________________________________________________________________
-------- -------
|FreeBSD | | |<--> ISP's
| System |<----------->| Modem | Gateway
| | xl0 | |
-------- -------
This is what your configuration will look like after completing this section. The xl0 symbol represents the connectivity from an internal or external dial out modem, or an Ethernet cable between a system NIC connected to a DSL or cable modem. FBSD communicates across this outbound link to your ISP and from there out to the public Internet.
There are basically two providers of access to the public Internet in service today worldwide, they are the public telephone industry and the cable television industry, because both have copper wires connected to your house and in some cases to your business location.
Wi-Fi (also spelled Wifi or WiFi) is a popular technology that allows an electronic device to exchange data wirelessly (using radio waves) over a computer network, including high-speed Internet connections. Personal computer manufactures now include Wifi connections on motherboards. Wifi service is most often provided by routers connected to LANs. Many business provide free Wifi access as a promotion to entice customers [ie; airports, hotels, cafés, malls, stadiums, convention centers and many other locations].The following sections deal with enabling cable Internet access on your FBSD system. For public telephone industry access to the Internet, jump to the Products offered by the public telephone company section.
First of all, the street where you live must have been wired for cable TV. The cable service provider generally provides the cable modem as part of the Internet service. Some cable providers will let you chose what kind of cable modem to use. Do not select a USB cable modem. If the external cable modem has both USB and Ethernet ports on it, always use the Ethernet port. An Ethernet connection is more reliable than USB. The cable modem uses a short Ethernet cable with UTP-45 connector plugs on each end to plug into the cable modem and the Nic card in your FBSD system. Cable service is an "always on" service and has security implications. The user must make provisions for installing a firewall to keep out unwanted intruders. Most cable Internet service is based on wide area network technology and uses DHCP to provide all the necessary connection info to your PC. Get the specific details from your cable Internet access provider.
If your PC doesn't have a built in NIC on the motherboard or if you want to add a different NIC to your PC follow these instructions.
First make note of the manufacture of the NIC and what chips are used on the printed circuit board, as you may need this info to locate the correct device statement if the GENERIC kernel can not identify your NIC. With the power off to your PC and with the PC case open, insert your PCI NIC card into any of the PCI slots. Plug in the Ethernet cable to the port on the external side of the NIC. Plug in the other end of the Ethernet cable into the cable modem. Power on your PC and cable modem.
PCI NICs come in different speeds. For the home user a 10Mbps speed NIC is more than adequate. Today prices have fallen so much on NICs that 10/100Mbps NIC are bargains and have almost forced the 10Mbps only NICs out of the market.
On the first boot after installing your PCI NIC review the boot messages by hitting the 'scroll lock' keyboard key and then use the 'page up' key. You can also edit the /var/run/dmesg.boot log to verify that it was found.
This is what you are looking for in the boot log,
This means the GENERIC kernel found your NIC.
dc0: <Macronix 98715/98715A 10/100BaseTX> port 0xdc00-0xdcff mem
0xe30000ff irq 3 at device 19.0 on pci0
dc0: Ethernet address: 00:80:c6:f2:2e:3b
miibus0: <MII bus> on dc0
dcphy0: <Intel 21143 NWAY media interface> on miibus0
dcphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
dc0 is the NICs internal interface name. Yours will more than likely be different, and that's ok.
The GENERIC kernel contains device statements for most of the NICs currently on the market. If the /var/run/dmesg.boot log shows your NIC as:
pci0: <unknown card> (vendor=0x1274, dev=0x5000) at 19.0
or no message to indicate the probe of the BIOS found any new PCI devices, then you may have legacy BIOS on your PC which does not handle PCI cards very well. On older (IE: pre Y2K) PC BIOSs, it's very common for the system probe process of the BIOS to be unable to find one or more PCI cards. If this happens to you, you have to do some research to determine the problem.
Try the pciconf -lv command to see if it gives you any useful info. Then review the GENERIC source at /usr/src/sys/i386/conf/GENERIC to see if it contains a device statement comment about your NIC based on the manufacturer or chips used. If you do find a device statement in the GENERIC source for your NIC, then add this statement to your kernel source and recompile your kernel:
device pun
This device has additional code to probe your system’s BIOS using different methods which in most cases results in your PCI NIC being found.
If the review of the GENERIC kernel source produces no results, then review the kernel source file named LINT at /usr/src/sys/i386/conf/ for comments that describe your NIC by manufacturer's name or chips used and copy the appropriate device statements to the GENERIC kernel source file. Then follow the instructions at Kernel Customizing. You will have to create a custom kernel from the GENERIC source including the device statement from the LINT source.
If you find no kernel device statements for your NIC, then it’s not supported and you have to get one that is.
Your cable provider has computers called DHCP (Dynamic Host Configuration Protocol) servers that will automatically provide your FBSD system with all the information it needs to communicate over the Internet. In order to communicate with the cable provider's DHCP servers, you must configure your system’s NIC that is cabled to the cable modem to use the DHCP client software that is built into your system.
Assuming your cable modem is physically connected to your cable provider with a functioning circuit, that the cable service's ISP has ‘provisioned’ the modem so they know your modem is authorized, and their DHCP server is running, you should be able to connect to your cable ISP.
First issue the following command to display all network interface parameters. You are looking for the NIC's interface device name.
ifconfig
If your NIC is found, it will show in this display.
dc0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
ether 00:80:c6:f2:2e:3b
media: Ethernet autoselect
status: no carrier
lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
The dc0 interface would be the interface name of your NIC. Yours will more than likely be different, and that's ok.
To active DHCP on that NIC, edit /etc/rc.conf and add the following statement:
ee /etc/rc.conf
ifconfig_dc0="DHCP"
Where dc0 is your NIC's interface name.
Reboot your system. After logging in issue:
ifconfig
This time you see the IP address assigned to you by your Cable ISP.
In this example it's 68.169.105.81
dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 68.169.105.81 netmask 0xffffff00 broadcast 68.169.105.255
ether 00:80:c6:f2:2e:3b
media: Ethernet autoselect (none)
status: active
On the command line enter a ping command to some known Internet site:
ping -c2 8.8.8.8
This tests if you can reach the Internet. This is a site I know is there. But like everything else it may go away in time.
Now check out that your ISP DNS servers are functioning correctly.
ping -c2 freebsd.org
Check that resolv.conf name server statements have automatically been filled in with the IP addresses of your ISP's DNS servers.
ee /etc/resolv.conf
It should look something like this, but contain your ISP specific info:
ee /etc/resolv.conf
It should look something like this, but contain your ISP specific info:
search your.isp_dhcp_server.net
nameserver 168.168.240.222
nameserver 168.168.240.225
Issue ifconfig one more time.
dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 68.169.105.81 netmask 0xffffff00 broadcast 68.169.105.255
ether 00:80:c6:f2:2e:3b
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
The status is now active. You now have a working connection to the public Internet. Your system is wide open; you are now vulnerable to attacks from the public Internet. It's best to power off your PC when you are not working on it, at least until you get a firewall installed. You should now go to the Network-Security section.
If you are unable to get DHCP to connect you to your cable ISP, call your tech support department and request them to verify they have ‘provisioned’ your modem and that they can ping it.
This FreeBSD Install Guide is an public domain HOW-TO. This content may be reproduced, in any form or by any means, and used by all without permission in writing from the author.