>Could someone out there give me some simple instructions how to use
>FreeBSD as a gateway/router to distribute a cable modem connection to
>several PCs?
>I have read the FreeBSD tutorial on how to route a PPP dial-up, but
>this network will only have 1 true IP address that originates at the
>Cable Modem. Specifically, I need instructions on how to make create
>fake IP addresses for the PCs that will be connected to the router
>through the hub
The PPP tutorial stuff largely applies. Did you buy "The Complete
FreeBSD"? I highly recommend it.
The following is off the top of my head, so I probably left out some
steps. I'd appreciate any corrections.
.------------------------.
| FreeBSD |
| |
| home.isp.domain.com
| NIC1 |--------------------| Cable Modem
| router
| NIC2 |
`---------- -.- -------'
|
|
.- -^- -.
| Hub |------------| MyPC1
| |------------| MyPC2
`-------'
(0) Assume that on home.isp.domain.com, NIC1 uses fxp0, and NIC2 uses
vx0. Furthermore, assume that you have things set up so that
home.isp.domain.com itself is successfully connected to the network
through the Cable Modem.
(1) Reconfigure router's kernel to enable IPFIREWALL and IPDIVERT at a
minimum.
options IPFIREWALL
options IPFIREWALL_VERBOSE
options "IPFIREWALL_VERBOSE_LIMIT=100"
#options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPDIVERT
Re-compile and re-install.
(2) Choose a fake network for NIC1, MyPC1, and MyPC2. Let's assume
you want router to be known as 10.0.0.1, MyPC1 as 10.0.0.5, and
MyPC2 as 10.0.0.6.
(3) Edit your /etc/rc.conf file.
...
firewall_enable="YES"
firewall_type="open" # Can make this more restrictive later
natd_enable="YES"
natd_interface="fxp0"
natd_flags="-s -m -u" # man natd(8) to find out what these do
...
network_interfaces="fxp0 vx0 lo0"
ifconfig_vx0="inet 10.0.0.1 netmask 255.0.0.0"
# You should have already set up for fxp0
...
gateway_enable="YES"
(4) Edit your /etc/hosts file. You don't need to do this if you
decide to run a local DNS for your fake network.
...
10.0.0.1 router
10.0.0.5 MyPC1
10.0.0.6 MyPC2
(5) Reboot the FreeBSD box. Configure MyPC1 and MyPC2 to use router
as their gateway, and your ISP's DNS for DNS.
--
http://www.cs.wustl.edu/~jxh/ Washington University in Saint Louis
Quote:>>>>>>>>>>>>> I use *SpamBeGone* <URL:http://www.internz.com/SpamBeGone/>