Build a Home-Office Router Using FreeBSD and …

2009-05-13 02:35:55来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


Build a Home-Office Router Using FreeBSD and PF
Created: 03/21/2006
General Information
This guide will outline the basic steps for building a home-office router for use with a cable modem or DSL line using FreeBSD and Packet Filter (PF).  It will cover updating FreeBSD, building a new kernel, and installing and configuring a DHCP server and DNS server to support a small internal network.
Requirements
  • Standard installation of FreeBSD 5.3 or greater
  • Two network cards
  • A text editor
    Before beginning, we need to decide which network adapter is going to be connected to the internal network and which one is going to be connected to the external network (cable modem or DSL line).
    Run 'ifconfig' from the command line to list the network adapters:
    $ ifconfig
    dc0: flags=108843 mtu 1500
            inet6 fe80::20c:29ff:fefc:800c%lnc0 prefixlen 64 scopeid 0x1
            inet 192.168.130.133 netmask 0xffffff00 broadcast 192.168.130.255
            ether 00:0c:29:fc:80:0c
    xl0: flags=108802 mtu 1500
            ether 00:0c:29:fc:80:16
    lo0: flags=8049 mtu 16384
            inet6 ::1 prefixlen 128
            inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
            inet 127.0.0.1 netmask 0xff000000
    For this document I am going to use the following configuration:
    dc0: external interface (IP address provided by ISP's DHCP server)
    xl0: internal interface (IP address is static, 192.168.10.1)
    Internal network: 192.168.10.0/255.255.255.0
    Installation
    Kernel source
    First, we need to ensure that the kernel source is installed.  We will need the kernel source to recompile the kernel to add PF support.  The kernel source can be installed using 'sysinstall' utility.
    From the sysinstall menu:
  • Select "Configure"
  • Select "Distributions"
  • Select "src"
  • Select "sys"
    Update the system
    Next we need to update
    the system
    (don't compile a kernel yet) and
    the ports tree
    .
    Install network services
    Once the system has been updated, we can install a few necessary services on our system; a DHCP server to provide IP addresses to clients on the internal network, and a DNS server to forward DNS requests from the internal clients to our ISP's DNS servers.
    DHCP server:
    #
    #
    cd /usr/ports/net/ics-dhcp3-server
    make install clean (the default options are fine)
    DNS server:
    #
    #
    cd /usr/ports/dns/bind9

    标签:

    版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

  • 上一篇:FreeBSD Splash Screen

    下一篇:把FreeBSD6.0作为自己的桌面