Installing PPP – alias
This article deals with setting up PPP aliases. This will allow other computers
to use your FreeBSD box as a gateway to your ISP. I will assume that you already
have PPP installed and running. If you haven’t installed PPP yet, you may wish to
read Installing PPP.
Note: alias is being deprecated
The -alias option on ppp is being replaced with the -nat option. Eventually, it
will be removed altogether.
What is a gateway?
A gateway is a link to another place. Your computer can be a gateway to your ISP
for other computers. It’s pretty darn easy to make FreeBSD act as a gateway.
Just add the following line to your /etc/rc.conf file:
gateway_enable="YES" # Set to YES if this host will be a gateway.
The easiest way to implement this change is to reboot. You can avoid the reboot
by issuing the following command instead of rebooting:
sysctl -w net.inet.ip.forwarding=1
But in either case, make sure you make the change to /etc/rc.conf so that the next time
you reboot, the machine acts as a gateway.
What is an alias?
An alias is another name for something. In networking terms, it’s a method for
translating one set of IP addresses for another set. Aliasing is also known as
Network Address Translation (NAT) and IP Masquerading. Most commonly, aliasing is
used to convert private addresses on the inside of a gateway to public addresses on the
outside of a gateway.
For more a bit information on aliasing, see natd
but come back here because you don’t really want natd if you have PPP. Or so I’ve
been told.
Adding aliasing to your PPP setup
The reference for this section is titled IP Aliasing and can be found at http://www.freebsd.org/tutorials/ppp/.
I suggest you read that first.
I added the following line to the default section
of /etc/ppp/ppp.conf:
alias enable yes
The PPP – Pedantic PPP Primer
has an excellent section on Configuring
Windows Systems to use your newly created gateway.
Testing the aliasing
All of these tests assume you are using another box on your network and not your
gateway box unless otherwise specified.
The easiest way to this this setup is to use one
of your other computers and trying pinging your ISP. Your modem should dial.
If it does, you’ve got it right! If you can’t try pinging from your gateway
box. If your modem dials up, then your other machine doesn’t have the gateway
properly specified. See Configuring
Windows Systems.
The next step is to browse to your ISP’s homepage. If you can’t do that, then try
the same thing on your gateway box. If it works on your gateway box, then the other
box does not have the DNS server set correctly. It should be set to your ISP’s DNS
server. If you are running a DNS on your gateway box, set it to that. See Configuring Windows Systems.
If you can’t browse to a website, try browsing to an IP address. Use nslookup
to get the IP address and enter that address into the browser. If that works, then
it’s definitely a DNS issue. The machine does not have it’s DNS server specified
properly. See Configuring Windows
Systems.