Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Static route not used at boot

    Scheduled Pinned Locked Moved Routing and Multi WAN
    1 Posts 1 Posters 538 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tagashy
      last edited by

      Hello everybody,

      I got a problem (hi captain obvious)

      i use L2TP for MLPPP with 2 wan who are connecting to an mpd5 server
      both wan are on dhcp.
      my l2tp server got two public ip
      my PFSense client has two static route which will redirect 1.1.1.1 to wan1 and 2.2.2.2 to wan2
      my configuration is:

      –---> WAN1(DHCP)
      [PFSense client]                              –---> [L2TP SERVER](ip 1.1.1.1, 2.2.2.2)
                              –---> WAN2(DHCP)

      here is the mpd5 configuration files generated by PFSense

      startup:
              # configure the console
              set console close
              # configure the web server
              set web close
      
      default:
      l2tpclient:
              create bundle static mlppp
              set bundle enable ipv6cp
              set iface name l2tp0
              set iface disable on-demand
              set iface idle 0
              set iface enable tcpmssfix
              set iface up-script /usr/local/sbin/ppp-linkup
              set iface down-script /usr/local/sbin/ppp-linkdown
              set ipcp ranges 0.0.0.0/0 0.0.0.0/0
              set ipcp enable req-pri-dns
              set ipcp enable req-sec-dns
              #log -bund -ccp -chat -iface -ipcp -lcp -link
      
              create link static mlppp_link0 l2tp
              set link action bundle mlppp
              set link enable multilink
              set link keep-alive 10 60
              set link max-redial 0
              set link disable chap pap
              set link accept chap pap eap
              set link disable incoming
              set link mtu 1492
              set auth authname "user"
              set auth password pwd
              set l2tp self 0.0.0.0
              set l2tp peer 1.1.1.1 10293
              open
      
              create link static mlppp_link1 l2tp
              set link action bundle mlppp
              set link enable multilink
              set link keep-alive 10 60
              set link max-redial 0
              set link disable chap pap
              set link accept chap pap eap
              set link disable incoming
              set link mtu 1492
              set auth authname "user"
              set auth password pwd
              set l2tp self 0.0.0.0
              set l2tp peer 2.2.2.2 10293
              open
      
      

      Now that the context is set, here come my problem:

      All work nice if it start after boot the l2tp connection, they are correctly routed to the correct wan, the link are up, the traffic pass, everything is fine.

      My problem is if i restart PFSense the l2tp connection will be up but don't care about my static route and all the traffic pass to only one link.

      why it is done (my opinion). i think that MPD5 is start before the routing , or the static routing, he'll wait until he can connect but take care of the routing table when it was start and not the actual one.

      so is there anyway to make mpd care about those static rules? (like starting mpd after the routing?)

      EDIT Using shellcmd don't change my problem the L2TP tunnel is still up but don't care about my static route```
      <shellcmd>mpd5 -b -k -d /var/etc -f mpd_mlppp.conf</shellcmd>

      I think this is done by the fact that PFSense is statefull because if i stop mpd5 for 30 sec then restart it everything work fine but if i restart it faster it'll keep the false (and old) route
      
      EDIT:2
      I've succcesfully make mpd5 care of my route but it's awful.
      What i've done:
      i add this section to /cf/conf/config.xml
      

      <shellcmd>/root/dmpd.sh</shellcmd>

      and dmpd.sh is
      

      #!/bin/sh
      kill $(cat /var/run/l2tp_mlppp.pid)
      sleep 30
      /usr/local/sbin/mpd5 -b -k -d /var/etc -f mpd_mlppp.conf -p /var/run/l2tp_mlppp.pid -s ppp l2tpclient

      but as i said i think it's awful so if someone has a better solution i'm listening :)
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.