Introduction: This document describes how to get Alpine4Linux running and also describes how to test basic connectivity and setup routing within the Alpine4Linux stack. Steps: 1. Download the Alpine4Linux tarball from: http://www.vzavenue.net/~neelnatu/alpine4linux/alpine4linux.tar.gz 2. Copy the tarball to a directory where you want to install the Alpine4Linux sources (e.g. /home/neel/src/) $ mkdir /home/neel/src; mv alpine4linux.tar.gz /home/neel/src 3. Explode the tarball and make it. $ cd /home/neel/src; tar xvzf alpine4linux.tar.gz $ cd alpine4linux; make If the make fails send an email to neelnatu@yahoo.com and I will try to help you. I have compiled it successfully on RedHat 8.x Linux. I also know it will *not* compile on a RedHat 6.x Linux. In the steps below I refer to the ALPINE_ROOT=/home/neel/src/alpine4linux. This is the top-level directory that contains Alpine4Linux sources, docs and scripts. 4. Run the alpine_server (the FreeBSD stack) A helper script is provided with the distribution to run the alpine_server. The script sets up the iptables so that packets destined to the alpine_server's IP address are dropped by the Linux stack. $ cd /home/neel/src/alpine4linux # chdir to the ALPINE_ROOT $ cd src/scripts $ chmod +w run_alpine_server.sh # make writable; so we can edit it Edit "run_alpine_server.sh" and set the variables ALPINE_ROOT, INTERFACE, ALPINE_IP, ALPINE_NETMASK appropriate to your setup. The "eth0" is the name of the Linux device the alpine_server uses to do raw packet I/O. This interface is known to the FreeBSD stack as "tap0". The second and third arguments are the IP/subnet assigned to "tap0". Note that the IP address must be distinct from that used by the Linux stack itself. $ su # alpine_server is run as superuser as it needs raw device access $ bash run_alpine_server.sh At this point you are running the FreeBSD stack on Linux. To stop the alpine_server press CTRL-C. In all the examples below I am assuming that the Alpine stack is assigned the IP address 10.11.12.13/255.255.255.0. 5. Pinging from another machine on the same subnet: If you have another machine on the same subnet, you can ping 10.11.12.13 and ensure connectivity. Unfortunately it is not always possible to ping 10.11.12.13 from the same Linux workstation and expect it to work. See the FAQ for more information about this. 6. Pinging from the same machine: You can use the "ping" code included in the src/sbin directory. You should use the script - "run_alpine_client.sh" included in the src/scripts directory. $ cd /home/neel/src/alpine4linux # chdir to the ALPINE_ROOT $ cd src/scripts $ chmod +w run_alpine_client.sh # make writable; so we can edit it Edit "run_alpine_client.sh" and set the variable ALPINE_ROOT to point to the root of the Alpine source tree. Pass in the program name and program arguments as arguments to the run_alpine_client.sh script. Make sure you are running the alpine_server before running the client. $ bash run_alpine_client.sh ../sbin/ping/ping 10.11.12.13 7. Running ifconfig against the Alpine4Linux stack: Note that we will be using the native Linux ifconfig. In the examples below, I assume that the "/sbin/ifconfig" is in your $PATH. If not, the you should use the complete path "/sbin/ifconfig" in the examples below. $ cd /home/neel/src/alpine4linux # chdir to the ALPINE_ROOT $ cd src/scripts # # "tap0" is configured by alpine_server on startup # It should have the same HWaddr as the corresponding Linux physical # interface ("eth0" in my example). It should also be configured with # the IP address and subnet mask specified in the "run_alpine_server.sh" # script. # $ bash run_alpine_client.sh ifconfig tap0 # "lo0" is not yet configured $ bash run_alpine_client.sh ifconfig lo0 # Configure "lo0" $ bash run_alpine_client.sh ifconfig lo0 127.0.0.1 $ bash run_alpine_client.sh ifconfig lo0 Also by this time you must have guessed that it is pretty painful to keep on typing the "bash run_alpine_client.sh" before every command. I usually define an alias in my ~/.bash_profile to help out: export ALPINE_ROOT=/home/neel/src/alpine4linux alias alpine_client_env='export LD_PRELOAD="libClientSocket.so libAlpineSupport.so";export LD_LIBRARY_PATH="$ALPINE_ROOT/src/client_socket:$ALPINE_ROOT/src/alpine_support"' Now I can setup my environment make the client use the Alpine4BSD stack simply by issuing the following command: $ alpine_client_env # Setup the environment $ ifconfig tap0 # "ifconfig" the Alpine stack $ ifconfig lo0 8. Check routes in the FreeBSD stack $ alpine_client_env # Setup the Alpine client environment $ $ALPINE_ROOT/src/sbin/route/route get 10.11.12.13 Check some more routes in the same subnet $ /home/user/alpine4linux/src/sbin/route/route get 10.11.12.13 If you get an error from "route", don't panic. This program is not very well tested/ported but it should be enough to get you by. See the FAQ for more information. 8. Setting up routing in the Alpine4BSD stack: $ alpine_client_env # Setup the environment variables Add a route for reaching all the hosts on our subnet. $ $ALPINE_ROOT/src/sbin/route/route -- \ add 10.11.12.0/24 -interface 10.11.12.13 Add a route for reaching all the loopback IP addresses via lo0. This command will fail unless you have configured lo0 earlier. $ $ALPINE_ROOT/src/sbin/route/route -- \ add 127.0.0.0/8 -interface 127.0.0.1 Add the default route. The gateway must itself be directly reachable, and therefore must be on the same subnet as that assigned to "tap0". $ $ALPINE_ROOT/src/sbin/route/route add default 10.11.12.1 9. Run the simple server in the src/test directory $ alpine_client_env $ $ALPINE_ROOT/src/test/t 10.11.12.13 80 Now you can telnet to 10.11.12.13:80 from any other box that has connectivity to the host Linux box. Alternatively you can telnet from the host Linux box itself as described below. In another window: $ alpine_client_env $ telnet 10.11.12.13 80 You can now type into the telnet window and the same characters appear on the stdout of the server and vice versa. 10. FTP server I have successfully tested vsftpd-1.1.3 against the Alpine4Linux stack. See the FAQ for some issues/workarounds related to vsftpd-1.1.3. I used the sample config file from the vsftpd tarball with one addition: I had to set "listen=YES" in the config file since the server is running standalone and not from inetd. $ su $ alpine_client_env $ vsftpd vsftpd.conf