Defcon-1-Logo

           [Home]    [FBSD Articles]    [Scripts Corner]    [Contribute]    [Search]    [FBSD Links]    [Files]

About Us

FreeBSD Articles
  *Hardware
  *Networking
  *Security
  *Software
  *X Windows


Files / Scripts
Newbies Corner
Tech. Talk
Tips and Tricks


FreeBSD Links

Articles in other
Languages :
  *French Articles
  *Spanish Articles

Want to Help ?
 
   Click Here

Email Users 5

Search:
 

 


FreeBSD Search:


 

 

Powered-By-Apache-Logo

Cable Modems 101 - How-To

This how to will tell you how to setup your cable modem with a Static IP with your @home cable modem. Also, included in this how to is allowing other machines that are behind your firewall access through the gateway FreeBSD machine attatched to the @Home Cable Modem.

Step #1
 First off you will need two network cards in your FreeBSD machine. These both need to be working modems, and completely configured and setup in the Kernel prior to starting this How-To Article. Once you have this done, continue to Step #2

Step #2
 We are going to use NATD to do the transfer of the traffic from the IP's behind the firewall that are going to have IP's of 10.0.0.x (For Example : 10.0.0.1 etc.) and transfering that traffic to the network card with the true Static IP number on your FreeBSD machine.
 *Note: for those that are not aware, a "Static IP" is a IP that never changes

 We will be doing modifications to the Kernel and to your rc.conf that is located in the /etc directoty on your machine.

Step #3
 Making changes to your Kernel, if you have never compiled a Kernel before, I will be including the step to do this as well so there is no chance of a problem.

 You will need to goto the /sys/i386/conf  whatever the name of your Kernel is you need to do "vi KERNEL_NAME"  or if you have never compiled a Kernel before, do the following command "vi GENERIC"  this will edit the default Kernel on your machine.

 I normally try to find a area in the Kernel to place all the items I manually add, but it doesnt matter where you place the below items. I normally place them under the USB items to goto this area do a "/USB" while you are in vi and it will take you to this area.
 Once you have a place selected where to enter these items, enter the following items in the Kernel.

options    IPFIREWALL
options    IPDIVERT
options    IPFIREWALL_VERBOSE
options    IPFIREWALL_DEFAULT_TO_ACCEPT

 *Note: make sure you type it as above, including the CAPS

 After you have entered the above into the kernel do a ":wq" and this will write and exit the editor. Now that we've got the items listed within the Kernel, you need to now compile the Kernel to make the items we've added active. If you know how to already compile your Kernel goto Step 5 otherwise, if you dont know for sure how to compile a Kernel, goto Step #4

Step #4
 Compiling the FreeBSD Kernel do, the following :

Being we are compiling a custom Kernel, we are going to nickname the Kernel name to be  ``hellokitty", NOTE: the Kernel is located in :
    /sys/i386/conf

Logged in as Root, type the following line.
   /usr/sbin/config GENERIC


Step A
 Once step 2 is completed and take you back to a prompt, type this line to start the compiling process.
     cd ../../compile/GENERIC

Step B

 Now we need to do make depend
     make depend

Step C
  Well we are almost done, the kernel has been compiled, we now to to make it.  So, type the following
     make

Step D
  This is the final Step, Type :
     make install


Step #5
 Now that the items have been added to your Kernel, and the Kernel is now done with the compile, we need to make a few changes to your rc.conf that is located in the /etc directory.

 Goto the /etc directory, and do "vi rc.conf"

In here we want to add the following lines within the rc.conf, need to keep in mind that your
Network Card type could be differnt then the ones showed and used in these examples. The
"fxp0" used in this example is the network card for the Static IP. The ed0 is the network card for the fake network, or machines that will be behind the firewall using the 10.0.0.x numbers.
 Add the following information to the rc.conf, or see if its located in the rc.conf, if so, dont add it twice.

natd_enable="YES"
natd_flags="-u -f /etc/natd.conf"
natd_interface="fxp0"
firewall_enable="YES"
firewall_type="open"
natd_flags="-m -log"
ifconfig_ed0="inet 10.0.0.1 netmask 255.255.255.0"

 Note: Keep in mind the "fxp0" is the external IP or Static IP, the "ed0" is the IP behind the firewall.

 Once all this is done, do "shutdown -r now" and once the machine comes back up, it should be running and passing traffic correctly.

 MB-
 GhostRdr
 Cajundave

 v.0126.02
 

Email Us

ghostrdr@defcon1.org

This site cannot be duplicated without permission

© 1998 - 2010 Defcon1, www.defcon1.org. Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.