OLSR doesn't work with two or more gateways

  • Hello all,

    Let me explain my scenario.

    3 WRAP cards with pfSense 1.0.1 and with eth0, ath0 and ath1 all of them.

    I use ath0 for mesh network and ath1 as an access point for compueters to connect. eth0 interface is my way out to internet, and I only have 2 of them connected as inernet gateways.

    The scheme should be like this:

    INTERNET                                                                                                          INTERNET
              |                                                                            |                                          |
      WAN1 (                                        WAN2(            WAN5(
              |–- LAN1(mesh)(                (            (
      OPT1(AP)(                                      OPT3(AP)(          OPT5(AP)(
              |                                                                            |                                          |
            LAPTOP                                                                                                              LAPTOP

    Mesh network is done through LAN interface, and my laptops should connect to internet using the WLAN created in every access point.

    pfSense3 (the one in the middle without internet) is configure with the box "Enable dynamic gateway" checked.

    If I configure OLSR in pfSense1 and pfSense5 (those which have internet access on WAN) in order to "Announce as Gateways", OLSR makes a mess and routes packages between both pfSenses forever.

    If I only "Announce Self as Gateway" one of the pfSenses, the routing works great. The problem comes with two (or more) gateways.

    Can anyone give me a detailed configuration for this kind of networks in order to work?
    Is there any special firewall rule I have to add?

    It could be pretty helpfull if and screenshot (or a detailed olsr.conf file) is added.

    Thanks from Spain.

  • This annoyed me too.  It may have something to do with FreeBSD not allowing multiple default gateways (but Linux does)?  Thank goodness my mesh only needs one default gateway right now.  I'm not sure why the olsr software doesn't simply reject foreign gateway route announcements when it's local gateway is functioning.  If you display the routes in pfSense gui, you'll probably see both gateway units have each other listed as default route.
    If you find a way to get multiple dynamic olsr gateways working on pfSense, please post the solution.
    The olsr mailing lists may provide insights (look for comments involving *BSD and gateways / default routes)…

    This possible work-around may seem crazy, but try adding the following two static routes to your gateway units (via the pfSense gui)...  route to local gateway ip  route to local gateway ip

    I hope some of this helps,

  • Yes, this is most likely due to the fact that FreeBSD does not support a true multiple gateway scenario.

    OpenBSD recently just picked up this support.  I am hoping that someone will port it over in due time.

  • Thank you guys. I'll continue working with one gateway till this option of multiple gateways is available.

    Have a good one.

  • This possible work-around may seem crazy, but try adding the following two static routes to your internet gateway units (via the pfSense gui)…  route to local internet gateway ip  route to local internet gateway ip

    [Solution] We reached the point where we needed multiple dynamic gateways for olsr, and my speculative suggested solution (quoted above) worked! So, for olsr, this kludge gets around the problem of FreeBSD not supporting a true multiple gateway. Caveat: If the local internet connection goes down then this node will NOT pass traffic on to another internet gateway, thus this node will become a "black hole" blocking internet access for everyone nearby; however, this unwanted effect can be fixed by adding a batch task to periodically ping test the local internet connection and then add or remove the static routes when appropriate.
    What is the shell command to add/remove static routes?

  • man route:
    route add mask "nettmask" "gw"
    and to delete
    route delete mask "nettmask" "gw"

Log in to reply