Network: Setting up internet sharing with a FreeBSD router

(last edit: 2001-09-12) Here is how to set up a simple router under Freebsd 4.1. This might also (probably even) work fine on older or newer version. If it doesn't mail me and I'll update this document. This how-to assumes you have one ethernet card with a internet connection (cable modem or so) and another one that goes to the internal network with(probably) windows pc's. Once your machine is done installing and assuming your hardware works in one go, this should only take an hour or so if you've never done this. Just follow these instructions litterally and you should be fine. Ok here we go. * First install freebsd using the boot floppys or cd's. You should choose the kern developer set when installing. You should aswer yes to installing the ports and linux compatibility. During the (post)install you should add pine,less,zsh,bash,CVSup and whatever else you like. * once installed go to your /etc and edit your inetd.conf In inetd.conf comment out (put a # in front of) everything exept the ftp and telnet lines. * Next make a file /etc/make.conf that says: (this is assuming you live in the netherlands, like moi.) ----------------------------------------------------------- USA_RESIDENT= NO NO_X= true MASTER_SITE_BACKUP?= \${DIST_SUBDIR}/ \${DIST_SUBDIR}/ MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP} MASTER_SITE_GNU= MASTER_SITE_PERL_CPAN= MASTER_SITE_GNOME= MASTER_SITE_KDE= ------------------------------------------------------------ * after this install ssh (if you want to connect securely from elsewhere) from /usr/ports/security/ssh by typing in that dir "make;make install;make clean" * next we'll config the kernel. Go to /usr/src/sys/i386/conf and copy GENERIC to ROUTER with "cp GENERIC ROUTER" Next edit ROUTER and add (doesn't really matter where, probably best to add right beneath the other options you'll see): -------------------------------------------------------------- options IPFIREWALL options IPDIVERT options IPFIREWALL_VERBOSE options IPFIREWALL_FORWARD options IPFILTER options IPFILTER_LOG options IPFIREWALL_VERBOSE_LIMIT=100 options IPFIREWALL_DEFAULT_TO_ACCEPT options MROUTING -------------------------------------------------------------- * next recompile your kernel. Read how to do it at: FreeBSD handbook * edit your /etc/rc.conf and add: -------------------------------------------------------------- gateway_enable="YES" network_interfaces="ed0 ed1 lo0" ifconfig_ed0="DHCP" ifconfig_ed1="inet netmask" hostname="" sshd_enable="YES" # natd & firewall shit firewall_enable="YES" #I think this was a typpo in this explanation it should be open #firewall_type="UNKNOWN" firewall_type="open" firewall_quiet="NO" natd_enable="YES" natd_interface="ed0" #dit is de netwerkkaart met internet verbinding natd_flags="-m -s" ---------------------------------------------------------------- * REBOOT your system Now your (very basic) router is complete! Have fun! Thats an order soldier Sjoerd Send your questions to:

Click here to go back to the index.