faq
search
add article
cool-stuff
how-to
main
tips
|
HOWTO: Connect to the internet with ppp |
 |
 |
 |
Posted by Jason on Sunday March 18, @05:09PM
from the Route-66 dept.
If you would like to connect your FreeBSD box to the internet using a modem, here is a quick and dirty HOW-TO.
FreeBSD even supports dial-on-demand networking, so your machine will dial your isp automatically when you start your browser.
There are only a couple of things you will need to do to connect to the internet.
[Connect a modem]
You will need to connect a modem to a serial port or use an internal modem that can be referenced with COM port number. FreeBSD doesn't work well with WinModems. (WinModems are modems that replace portions of the electronics with software- usually part of the drivers. WinModems are often referred to as Laboto-Modems)
[Modify the /etc/ppp/ppp.conf file]
Login as root, change to the /etc/ppp directory and use vi or ee to edit the ppp.conf file.
cd /etc/ppp
ee ppp.conf
You should only need to modify four lines of the file. (device refers to your serial port- com1 is cuaa0 and com2 is cuaa1). Here's what you change:
set device /dev/cuaa0
set authname YOUR_ISP_LOGIN_NAME
set authkey YOUR_ISP_PASSWORD
set phone 999-9999
Here is what the entire ppp.conf file looks like:
#/etc/ppp/ppp.conf
default:
set device /dev/cuaa0
set speed 115200
disable pred1
deny pred1
disable lqr
deny lqr
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 8 \"\" AT OK-AT-OK \\dATDT\\T TIMEOUT 40 CONNECT"
set redial 3 20
#end default
demand:
set authname YOUR_ISP_LOGIN_NAME
set authkey YOUR_ISP_PASSWORD
set phone 999-9999
set timeout 0
add default HISADDR
set openmode active
accept pap
set ifaddr 127.1.1.1/0 127.2.2.2/0 255.255.255.0
add 0 0 HISADDR
#end demand
[Modify the /etc/ppp/ppp.linkup file]
Login as root, change to the /etc/ppp directory and use vi or ee to edit the ppp.linkup file.
cd /etc/ppp
ee ppp.linkup
Edit the file to read
#/etc/ppp/ppp.linkup
demand:
delete ALL
add 0 0 HISADDR
#
MYADDR:
add 0 0 HISADDR
[Edit /etc/resolv.conf]
The resolv.conf file contains your ISP's DNS server IP address's. Here is how to set it up.
cd /etc
ee resolv.conf
Edit the file to read
search YOUR_ISP.COM
nameserver YOUR_ISP_DNS_1
nameserver YOUR_ISP_DNS_2
[Edit /etc/rc.conf]
You will need to add the following text to your /etc/rc.conf file. These commands will start the ppp protocol and setup dial-on-demand.
Login as root and edit /etc/rc.conf
cd /etc/
ee rc.conf
Append these lines to the file
ppp_enable="YES"
ppp_mode="auto"
ppp_nat="YES"
ppp_profile="demand"
ppp_enable -Starts userland ppp daemon at startup.
ppp_mode -Sets the mode. Use auto for dial-on demand, use ddial for a persistent 24/7 connection.
ppp_nat -Tells ppp to use network address translation.
ppp_profile -Tells ppp what tag to use in your /etc/ppp/ppp.conf file.
[Reboot]
After you restart your computer, try to ping your isp. It should trigger the modem to dial the connection and ping them. Next, try to ping an internet website. If that works, you should be in business.
(note: if you would like a copy of the files mentioned in this posting, download the file attachment to the right ppp-sample.tar and extract the two files with the command tar xvf ppp-sample.tar
Important Stuff:
Note: Fields with bold titles are required.
Please try to keep posts on topic.
Try to reply to other people comments instead of starting new threads,
Read other people's messages before posting your own to
avoid simply duplicating what has already been said.
Use a clear subject that describes what your
message is about.
Please do not post offtopic, inflammatory, inappropriate, illegal,
or offensive comments. Repeat offenders will be sanctioned.
|