SearchWiki:

TheMilkfish

MilkfishServices

Boozy Milkfish

Milkfish-dd

Doozy Milkfish

Woozy Milkfish


Main.SideBar (edit)


Legal Information

Recent Changes Printable View Page History Edit Page

Please only use firmware versions which were announced as an official release on www2.milkfish.org if you want to get a stable setup.

Mini-howto: Installing Boozy Milkfish 3.0.0 and 3.2.0

Installation time: 5 minutes
Requirements: No Linux experience necessary (100% browser based installation)

  1. Download the correct firmware image for your router hardware from here (berlios) or here (sourceforge). Example: For a Linksys WRT54GL choose openwrt-wrt54g-squashfs.bin. If unsure, simply do continue here.
  2. Flash your router with the image (via original web interface or openwrt webif or tftp). Note: Wait until all LEDs on the router stop blinking and go static. Flashing your router with milkfish/openwrt firmware will void your warranty!
  3. If you do not see this screen and your router appears to have hung up, repeat step 2 after a reboot (or power cycle) with the WAN cable unplugged
  4. Browse your routers IP on your web browser (new linksys routers have IP address 192.168.1.1) and set administrator password (only necessary once after a fresh Openwrt Installation)
  5. Configure your Network WAN Settings to connect to the internet (if you unplugged the cable in step 2, plug in again now)
  6. Go to Category "System" - "Installed Software" and click "Update package lists" (internet connection needs to be up from now on)
  7. Install the milkfish-sip-with-webif package (Please also consider to get the curl package from the backports repository if you want to use Homesip or Audit securely via https)
  8. This should lead to this screen. If you get errors, remove all milkfish packages and repeat this step once - if the same errors still appear, try with the firmware we provide and/or take the error to the forum. (all the necessary packages for the main SIP router scenario are downloaded and installed with milkfish-sip-with-webif due to dependencies)
  9. Reboot your router (unplug power and plug in again or use the console command "reboot") and check the Milkfish Status Page (screenshot is similar). If you only see "About" and "Status" in the "Milkfish" Category, remove the milkfish- packages and install them one at a time.
  10. Set the outbound proxy in your phones with provider accounts to the milkfish router ip and disable STUN. Phones which are only used internally need to be set to use the milkfish router as their registrar...
  11. ...and an account needs to be created on the milkfish web interface database section (to use the database frontend on the web interface hit the "Update Database" button first)

Mini-howto: Installing Boozy Milkfish 2.0.0

Installation time: 5 minutes
Requirements: No Linux experience necessary (100% browser based installation)

  1. Download the correct firmware image for your router hardware from here. Example: For a Linksys WRT54GL choose openwrt-wrt54g-squashfs.bin. If unsure, simply do continue here.
  2. Flash your router with the image (via web interface or tftp). Note: Wait until all LEDs on the router stop blinking and go static. Flashing your router with milkfish/openwrt firmware will void your warranty!
  3. Browse your routers IP on your web browser (new linksys routers have IP address 192.168.1.1) and set administrator password (only necessary once after a fresh Openwrt Installation)
  4. Configure your Network WAN Settings to connect to the internet
  5. Go to Category "System" - "Installed Software" and click "Update package lists" (internet connection needs to be up)
  6. Install the milkfish package (internet connection needs to be up)
  7. Reboot your router (unplug power and plug in again or use the console command "reboot") and check the Milkfish Status Page
  8. Set the outbound proxy in your phones with provider accounts to the milkfish router ip and disable STUN.
  9. Phones which are only used internally need to be set to use the milkfish router as their registrar and an account needs to be created on the milkfish web interface database section (to use the database frontend on the web interface hit the "Update Database" button first)

On a Linksys WRT54GL this installation leaves you with the following memory utilization:

 root@OpenWrt:~# df
 Filesystem           1k-blocks      Used Available Use% Mounted on 
 /dev/root                 1408      1408         0 100% /rom 
 /dev/mtdblock/4           1856      1000       856  54% / 
 none                      7188        60      7128   1% /tmp 
 root@OpenWrt:~#

Mini-howto: Upgrading from 1.0.0 to 1.1.0 - v1.0 hardwares only

This is the first official release having all necessary packages already integrated in one flashable binary. If you install for the first time on your v1.0 hardware, you can follow the detailed StepByStep Howto for Release 1.0.0 below and skip the sections on package download and setup.

1. set nvram boot_wait=on
(see StepByStep for Release v1.0.0 below for how to do this for the first time...)

  root@OpenWrt:/# nvram set boot_wait=on
  root@OpenWrt:/# nvram commit

2. FLASH

  tftp 192.168.1.1
  tftp> rexmt 1
  tftp> binary
  tftp> trace
  tftp> put boozy_milkfish-1.1.0.bin
  wait until lights are static

3. REBOOT

  telnet to lan_ipaddr of wrt
  nvram set boozy_firstboot= (erasing the nvram variable completely)
  nvram commit

4. REBOOT into failsafe mode

 press reset button for 2 sec when dmz light goes on
 (if the router should reboot normally, you have to erase boozy_firstboot nvram variable again)
 router will be in failsafe mode (192.168.1.1) when the DMZ LED flashes quickly for one second
 and then is off for the next second, and so on.

5. TELNET to 192.168.1.1 of wrt (failsafe lan_ipaddr of router)

  @OpenWrt:/# mount | grep jffs

if no output, then no jffs partition is mounted -> let's generate a jffs partition from the squashfs partition with...

  @OpenWrt:/# firstboot
  Creating jffs2 partition... done
  creating directories... done
  setting up symlinks... done
  @OpenWrt:/#
  check if no nvram commit is running (ps -aux ;-) then

6. REBOOT

 wait a while then try ssh (root@<lan_ipaddr of wrt>) with password "admin" and
 check web interface with your browser.
 configuration of wan interface (e.g. pppoe: ppp_username=<yours>, ppp_password=<yours>,
 wan_proto=pppoe, wan_ifname=ppp0, pppoe_ifname=<vlan1>) via web interface "Settings"
 Commit NVRAM !
 start of firewall via web interface "Firewall"
 this takes some time, progress can be checked in a ssh seesion with "ps | grep shorewall"
 give it 10 minutes. then check the firewall overview: long list means success.
 if firewall test is ok (you can surf etc.) go to Settings and set firewall_bootstart=1 and

7. FINAL REBOOT

  check status via web interface "Status"
  check internet connection
  check firewall
  check voip


StepByStep for Release v1.0.0

This document describes all necessary setup steps for installing Openwrt Linux and The Milkfish Communication Server on a Linksys WRT54GS v1.0.

Newer hardware than WRT54GS v1.0 will be supported after the first stable release of Openwrt supporting the newer hardwares, expected towards the end of 2005. Until then, this StepByStep pages may still be valuable in assisting installation on non-supported yet already-running Openwrt firmwares based on the White Russian Beta Release.

This manual covers the following issues:

  1. Internet access over a gateway
  2. DNS resolving setup
  3. ipkg package installation
  4. Dropbear SSH Server setup
  5. Sip Express Router Package installation
  6. Milkfish Package installation
  7. PPPoE broadband connection customization and setup
  8. Ramdisk logging setup
  9. Shoreline firewall (shorewall) setup

StepByStep 1 - boot_wait

  1. Open your browser and type in the IP of your router - initially this is 192.168.1.1 .
  2. You are asked for username and password - leave the username field blank and type admin in the password field and login.
  3. Set a static external IP address and submit the change. Check upon page reload if the settings have been commited.
  4. Navigate to the Administration page, from there to the Diagnostics page.
  5. Instead of pinging an IP, enter the following 'addresses':

 ;cp${IFS}*/*/nvram${IFS}/tmp/n
 ;*/n${IFS}set${IFS}boot_wait=on
 ;*/n${IFS}commit
 ;*/n${IFS}show>tmp/ping.log

Check the list which's being presented for the line boot_wait=on - if positive you can proceed with ...

StepByStep 2 - Flashing

  1. Get an appropriate binary from the Boozy download area - e.g. the boozy-mf-gs-code.bin for a WRT54GS v1.0 . For later devices wait for our next release, get a potentially working firmware from Openwrt.org, or build the binaries on your own. Check the section on Flashing for details on the latter procedure.
  2. On a linux console, change to the directory with the binary in it and use tftp to upload it to the router.

This process is called 'flashing' because the binary file is uploaded to the flash memory of the router where usually only the original firmware is located. Therefore, by (over)writing the flash you void the warranty of the device since you alter essential parts of it.

You also loose the nice blueish web interface you used before to enter that ping-thing. One could compare the flash memory in the router with an router-integrated USB memory stick.

However, unplug the power of your router and enter on your console:

 tftp 192.168.1.1
 tftp> binary
 tftp> rexmt 1
 tftp> trace
 Packet tracing on.
 tftp> put sipath-gs-code.bin

After executing the put command, plug the power in again.

Upload should commence after a little while and have an output like this when finished:

 <--snip-->
 received ACK <block=3010>
 sent DATA <block=3011, 0 bytes>
 received ACK <block=3011>
 Sent 1541120 bytes in 310.5 seconds
 tftp>

Let the router reboot after the upload. This may take up to some minutes because the file system needs to be generated.

StepByStep - Router Configuration

Openwrt Specifics

The Openwrt linux environment is quite different from a usual desktop linux. This is due to the embedded architecture of the device. Let me sketch the main differences briefly here:

  • NVRAM variables for semi-permanent settings like the IP settings of the device. Accessibility is given through the nvram tool. Details about the NVRAM you can find in http://openwrt.org/OpenWrtNVRAM.
  • A flash 'harddisk' with limited write cycles (some ten-thousand?) but persistency over reboots and power offs - like a memory stick.
  • A ROM partition with the system core files mounted in /rom.
  • A ramdisk with unlimited write cycles (but no persistency over reboots) being mounted into the /tmp directory for often changing files like log files.

Temporary internet connection through gateway

First of all, a internet connection would be nice. There are different ways to do that, depending on your scenario. I'll explain here the simplest and for a new router setup I'd even say recommended way of getting on-line, and thereby installing all the packages and so forth. Open a console and telnet to your router

 telnet 192.168.1.1

If flashing was successful, you should be presented with the Openwrt ASCII welcome banner.

I once ecountered a problem with connecting to the router when I used an outdated buildroot for building binaries for new hardware. I'm giving this hint because if everything is ok you are not asked for a password when using telnet at this point of the 'StepByStep Setup Continuum'.

Anyway, change your internal gateway settings by altering the respective NVRAM variable

 nvram set lan_gateway=<your_internally_reachable_gateway's_ip>

To disable the lan_gateway later just set it to 0.0.0.0:

 nvram set lan_gateway=0.0.0.0

Check similar settings with

 nvram show | grep gateway

Your wan_gateway setting should be set to 0.0.0.0.

If not the case, execute

 nvram set wan_gateway=0.0.0.0

and commit the NVRAM changes...

 nvram commit

...to be effective after:

 reboot

After reboot you should be able to ping your favorite IP.

DNS - the resolv.conf file

Now, let's take care of DNS. Domain Name Service is provided by DNS-Servers which in turn are commonly listed in the file /etc/resolv.conf.

A possible content of that file could be

 search
 nameserver <1st-dns-ip> <2nd-dns-ip>

No reboot was necessary on my box to have successful pings immediately after entering valid DNS IP's into resolv.conf. The settings made in /etc/resolv.conf are static and reboot-persistent since /etc is on the flash partition.

Symbolic File Links

Later, a PPPOE daemon may provide connection specific DNS information upon connection setup in a dynamic /tmp/resolv.conf file. If you'd like to use that feature later, simply replace our /etc/resolv.conf with a symbolic link to the file in /tmp by executing the following line whilst being in the /etc directory.

 cd /etc
 ln -s /tmp/resolv.conf resolv.conf

Similarly, you can repair or reset symbolic links to files on the rom since initially most files are just linked to their respective templates on the read-only rom partition.

The vi Editor

To replace or alter the files you can make a little shell script and place it in the /usr/sbin/ directory. Syntax could be simply rw <filename> to copy a rom-linked file with the same name and location to the flash partition. To set up that script, change to the /usr/sbin directory and type:

 vi rw

This opens the vi text editor. Hit a to enter the edit mode and generate the following content:

 #!/bin/ash

 cp $1 $1.cp
 rm $1
 mv $1.cp $1

Exit and save by hitting ESC followed by : and an x. Finally, Return executes the command and get's you back to the console.

Here you need to make the file executable by changing the file flags:

 chmod 777 rw

The Package Management Configuration File aka. ipkg.conf

Now quickly to /etc and

 rw ipkg.conf

After that do

 vi ipkg.conf

where you can configure the Milkfish internet package repository by adding this line, if possible as the first line in the list:

 src milkfish http://packages.milkfish.org/boozy/

Dropbear SSH Server

After that, you can check for actually available packages by

 ipkg update

and install the neat and security-enhancing dropbear ssh server with

 ipkg install dropbear

Please provide a well-chosen password during the installation process.

Milkfish Packages

After all these preliminaries, let's install the Milkfish specific files.

You can start with a

 ipkg install ser

which takes some time since the SER package is considerably large (~500kB).

After that, you may

 ipkg install milkfish

and

 reboot

the router.

Although SER and especially the dbtext database module is contained in the SER package, it is prepared and started with an init script being part of the Milkfish package.

To use the serctl script it may be convenient to add the following line to the file /etc/profile:

 export SIP_DOMAIN=$(nvram get lan_ipaddr)

The profile file affects the console shell and so changes to it become effective by the time of your next login.

Still having the opportunity to get some packages over the gateway, you should consider to install the configurable shoreline firewall, aka. shorewall, as potentially very useful for the Milkfish standard application. Although configuration details follow further below, for now you could just preparationally download it to the router with

 ipkg install shorewall

Please note that this shorewall package will be downloaded from the Milkfish Package repository.

The PPPOE Daemon

For connecting to the internet you may want to use broadband (DSL) or cable and therefore you could have thought of using the pppoecd package. Its source is already known since it's a standard package and installation follows the usual pattern by executing

 ipkg install pppoecd

PPPOE needs some additional customizations depending on your account data of your Internet Service Provider and your type of hardware.

These customizations are stored in NVRAM variables by using the nvram tool.

For a WRT54GS with the Internet port being named vlan1 they are:

 nvram set wan_ifname=ppp0
 nvram set wan_proto=pppoe
 nvram set pppoe_ifname=vlan1
 nvram set ppp_username=<your_username_at_your_isp>
 nvram set ppp_passwd=<your_password_at_your_isp>
 nvram set ppp_redialperiod=30
 nvram set ppp_idletime=5
 nvram set wan_mtu=1492

Don't forget to

 nvram commit

and consider to do a

 reboot

(which took some time on my box...).

For your convenience, here is Section 3 of the Openwrt README.pppoe:

 3. NVRAM variables
 ------------------

 In order for the PPPoE link to be established by the networking
 scripts the following NVRAM variables must be present:

 wan_ifname         Should be set to: ppp0

 wan_proto          Should be set to: pppoe

 pppoe_ifname       Set it to the WAN interface on which the PPPoE is to function.
                    On a 2.0 or a GS model it is usually vlan1.
                    The 1.0 and 1.1 models used vlan2.

 ppp_username       User name for your PPPoE connection.

 ppp_passwd         Password for the connection.

 ppp_redialperiod   Time between reconnect attempts.
                    Usualy set to 30.

 ppp_idletime       Time the link has to stay dead before reconnecting.
                    Usually set to 5.

 wan_mtu            The Maxumum Transfer Unit for the PPPoE connection.
                    Typically 1492.

 Please consult the Openwrt WIKI or the Openwrt Forum for more information on NVRAM variables.

Firewall Configuration

This section is about how to configure the Shoreline Firewall aka. Shorewall. Shorewall has a very convenient and structured configuration philosophy which consists of separate files providing the necessary level of abstraction to make firewalling transparent and understandable for humans. Each file contains besides many examples a comprehensive explanations on how to do the settings properly.

All configuration files can be found in the /etc/shorewall directory.

Let's start with the most abstract one, the zones file. It should include all zones or realms neighboring to your router:

  1. the internal network
  2. the external network, being the internet in this case

Since the neighboring zones are necessarily to be connected to the router by different interfaces, you need to define a third zone being the one between your router and your dsl or cable modem so that the bottom of the zones file will look like this

 #ZONE   DISPLAY         COMMENTS
  net     Net             Internet (ppp0)
  wan     WAN             WAN Port (vlan1)
  loc     Local           Local networks (br0)
 #LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE

NOTE: This is on a WRT54GS v1.0 having vlan1 as native wan interface.

Second file will take care of the actual and therefore less abstract zone-to-interface assignment:

 #ZONE    INTERFACE      BROADCAST       OPTIONS
  wan     vlan1           detect          routefilter
  net     ppp0            detect          routefilter, norfc1918
  loc     br0             detect          routeback
 #LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE

The configuration above is intended for static addressing in your local network. If you need DHCP support add this option accordingly.

Third file of interest is the policy file which contains abstract access policies depending on the zones settings already mentioned.

 #SOURCE         DEST            POLICY          LOG             LIMIT:BURST
 #                                               LEVEL
 loc             net             ACCEPT
 net             all             DROP            info
 # If you want open access to the Internet from your Firewall
 # remove the comment from the following line.
  fw              net             ACCEPT
  loc             fw              ACCEPT
  fw              loc             ACCEPT
  fw              wan             ACCEPT
  loc             wan             ACCEPT
 #
 # THE FOLLOWING POLICY MUST BE LAST
 #
 all             all             REJECT          info
 #LAST LINE -- DO NOT REMOVE

The settings are self explaning if you read each line like that

 Traffic from <SOURCE> to <DEST> will be <POLICY>ED.

You thereby made it to the rules file where it becomes a bit more technical, so let's have a look first:

 #ACTION  SOURCE         DEST            PROTO   DEST    SOURCE     ORIGINAL    RATE  USER/
 #                                               PORT    PORT(S)    DEST        LIMIT  GROUP
 #      Accept DNS connections from the firewall to the network
 #
 AllowDNS        fw              net

 #       Accept SSH connections from the local network for administration
 #
 AllowSSH        loc             fw

 #       Accept SSH connections from the internet for administration
 #AllowSSH        net             fw

 #       Allow Ping To And From Firewall
 #
 AllowPing       loc             fw
 AllowPing       fw              loc
 AllowPing       fw              net

 #       Allow Ping To Firewall from internet
 #
 #AllowPing       net            fw


 # Milkfish specific rules

 ACCEPT          loc             fw      udp     5060 1024:
 ACCEPT          net             fw      udp     5060 1024:
 ACCEPT          wan             fw      udp     5060 1024:
 ACCEPT          fw              net     udp     1024: 5060
 ACCEPT          fw              wan     udp     1024: 5060
 ACCEPT          fw              loc     udp     1024: 5060
 ACCEPT          loc             net     udp     1024: 1024:
 ACCEPT          loc             wan     udp     1024: 1024:
 ACCEPT          net             loc     udp     1024: 1024:
 ACCEPT          wan             loc     udp     1024: 1024:

 #
 # OpenWRT specific rules:
 # allow loc to fw udp/53 for local/caching DNS servers to work
 # allow loc to fw tcp/80 for weblet to work
 # allow loc to fw udp/67 and udp/68 for dnsmasq's dhcpd to work
 AllowDNS        loc             fw
 AllowWeb        loc             fw

 #LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE

The first three of the Milkfish specific rules are to enable SIP signalling on the standard SIP port 5060 from all directions to the router.

Furthermore you need to permit RTP traffic which carries the media and is established upon SIP signalling. These media streams may use arbitrary ports above 1024 so all these ports are enabled for traffic pass-through which is configured in the following lines. Again, the whole file becomes transparent and understandable after reading the explanations provided in the upper part of the file.

Last not least, the masq file:

 #INTERFACE              SUBNET          ADDRESS         PROTO   PORT(S)
 vlan1                   br0
 ppp0                    br0
 #LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE

In the windows world Masqerading is called NAT, standing for Network Address Translation. Whatever... Concerning the customization of config files, you are through now.

The next step thats needs to be done, is setting up logging at router startup. This can be accomplished by editing the /etc/inittab file. Make it writeable first with the rw script used before.

 cd /etc
 rw inittab

and then add these two lines using vi editor

 ::respawn:/sbin/syslogd -n
 ::respawn:/sbin/klogd -n

After that you need to create a directory for the log files, being /var/log. Since this is on the ramdisk it will be lost during reboots or power outages, so it needs to be created during the boot process. This is done by editing the file /etc/init.d/rcS after you made it writeable:

 cd /etc/init.d
 rw rcS
 vi rcS

adding the line mkdir /var/log to make it look like this

 #!/bin/sh

 # Start all init scripts in /etc/init.d
 # executing them in numerical order.
 #

 <--- snip --->

    esac
 done
 mkdir /var/log

It seems we are almost up and running, let's check the important Shorewall box displayed at the time of ipkg installation if anything else needs to be done...

 ***************************************************************
 * Please edit the configuration files found in /etc/shorewall *
 * and make sure they match your router's configuration before *
 * proceding to reboot! (esp /etc/shorewall/interfaces)        *
 *                                                             *
 * Please also setup your logging as described in the WIKI MINI*
 * HowTos at http://www.openwrt.org/MiniHowtos so that your    *
 * logs aren't written to flash which may shorten its lifetime!*
 *                                                             *
 * When you are satisfied by your firewall's configuration run:*
 * /etc/init.d/shorewall check &&\                             *
 * /etc/init.d/shorewall start                                 *
 *                                                             *
 * this will ensure you configuration is syntactially correct  *
 * and start the firewall, saving the tables so that they may  *
 * be restored on reboot quickly.                              *
 *                                                             *
 * When you are sure that your firewall is correctly running   *
 * rename the RC script so that it is run on boot:             *
 * rm /etc/init.d/S45firewall                                  *
 * mv /etc/init.d/shorewall /etc/init.d/S45shorewall           *
 ***************************************************************

If not already done, remove the default route for the lan interface by executing

 nvram set lan_gateway=0.0.0.0
 nvram commit
 reboot

Ok, you can try your configuration with:

 /etc/init.d/shorewall start

This takes some time since everything you set needs to be computed.

After Shorewall startup, you should test all connections from your computers to the internet before replacing the standard firewall startup script with the shorewall startup script:

 rm /etc/init.d/S45firewall
 mv /etc/init.d/shorewall /etc/init.d/S45shorewall
 reboot
Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on January 08, 2008, at 11:58 PM