several l2tp client links from one machine

Help
olegeech
2013-01-30
2013-03-27
  • olegeech
    olegeech
    2013-01-30

    Hello.
    I have a problem trying to find way to set up several l2tp client links to provider from different accounts on the one machine (FreeBSD 8.2).
    Provider allows to establish vpn session only from specific ip-address with respectively accounts credentials. I guess, there is no problem editing mpd.conf  to start several links together, but i still cant find aproach to establish l2tp tunnel for each link from specific ip.
    I have an interface with multiple aliased ip-addresses:

    sk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
            options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
            inet 10.244.14.53 netmask 0xffffff00 broadcast 10.244.14.255
            inet 10.244.14.84 netmask 0xffffff00 broadcast 10.244.14.255
            inet 10.244.14.89 netmask 0xffffff00 broadcast 10.244.14.255

    routing table:
    Destination        Gateway            Flags    Refs      Use  Netif Expire
    10.255.255.254     10.244.14.254      UGHS        0 59805192   sk0

    l2tp server is 10.255.255.254

    Mpd, while initialized session, alway's take the first ip from interface:

    mpd: L2TP: Initiating control connection 0x285e0d08 0.0.0.0 0 <-> 10.255.255.254 1701
    mpd: L2TP: Control connection 0x285e0d08 10.244.14.53 53193 <-> 10.255.255.254 1701 initiated

    I've tried option "set l2tp self addr", but it was unsuccessful. Is there any way that i can originate each link from certain ip-address?

    Thanx!

     
  • Display your mpd.conf, please

     
  • olegeech
    olegeech
    2013-02-02

    default:
      load l2tp_client_1
      load l2tp_client_2

    l2tp_client_1:
      create bundle static B1
      set iface up-script /usr/local/etc/mpd5/up-script.sh
      set iface down-script /usr/local/etc/mpd5/down-script.sh
      set iface enable tcpmssfix
      create link static L1 l2tp
      set link action bundle B1
      set l2tp self 10.244.14.53
      set auth authname <LOGIN1>
      set auth password <PASSWORD1>
      set link max-redial 0
      set link mtu 1480
      set link keep-alive 20 75
      set l2tp peer "10.255.255.254"
      open

    l2tp_client_2:
      create bundle static B2
      set iface up-script /usr/local/etc/mpd5/up-script.sh
      set iface down-script /usr/local/etc/mpd5/down-script.sh
      set iface enable tcpmssfix
      create link static L2 l2tp
      set link action bundle B2
      set l2tp self 10.244.14.84
      set auth authname <LOGIN2>
      set auth password <PASSWORD2>
      set link max-redial 0
      set link mtu 1480
      set link keep-alive 20 75
      set l2tp peer "10.255.255.254"
      open

    When second link started, it whatever takes the first ip on iface sk0, and it fail's.

     
  • Do you can open links manually ?
    And before this, type "show l2tp" and look to "Self addr" variable.

     
  • Why don't you use "set l2tp self" commands?