How to build a gatewayThis article shows you where to get some of the information needed in order to build a gateway. This will allow your computers to share a single connection to your ISP.
I’ve just thrown this article together from other documents I’ve written. It should work. But if it doesn’t, please add your comments and give me a hard time about it. Please remember to point out the problem you had.
Gateway?A gateway allows one computer to talk to an outside network and channel requests from other computers. If you have more than one computer, it makes sense to have one of them act as the gateway to your ISP. It allows all of your computers to share a single modem. It’s easy and it’s cheap.
I will assume that you are using a dial-up connection. But if you have a cable modem or ADSL, don’t worry, this is pretty much the same for you too.
Install FreeBSDThe first thing you should do is install FreeBSD. There are several guides:
So, let’s continue and assume you have 3.2-Release (or similar) installed.
Making it a gatewayTo make a FreeBSD box into a gateway, you need to add this to /etc/rc.conf:
gateway_enable="YES" # Set to YES if this host will be a gateway.
Enabling PPPTo get PPP going, you should see:
Aliasing or NATBecause you are using PPP, you’ll want to add the alias option in order to translate the private addresses to public addresses.
If you are using a cable modem or ADSL, you’ll want to perform NAT. See:
Configure the clientsThe next step is to make the other machines on the network talk to the gateway. This is done by adding the following line to /etc/rc.conf:
You should replace 10.0.0.1 with the actual IP address of your gateway. NOTE: you want the IP address given to your network card, which is not necessarily the one given to you by your ISP. It might be something like 192.168.0.45 or 10.0.0.1.
After making the above change, you should reboot.
For Windows, look under Control Panel->Networks->Protocols->TCP/IP->Default Gateway.