I have setup an l2tp client using xl2tp to connect to an l2tp vpn server. The server connection requires that the connection be setup WITHOUT ipsec. So I have set up a basic xl2tp connection. The connections seems to work and I get an ip address from the vpn server, that is visible when I run ifconfig. However I cannot ping any ip's on the network I have connected to, there is a specific ip on that network I need to connect to:, however when I attempt to I get this error: "ping: sendmsg: No such device". I try the ping with command: ping -I ppp0 I have tried connecting to the vpn from other machines, the ip address that I get assigned are for example:, or, or all in the 10.10.2.xxx subnet,

  1. This is my xl2tpd.conf:

    access control = no
    auth file = /etc/ppp/chap-secrets
    debug avp = no
    debug network = no
    debug packet = no
    debug state = no
    debug tunnel = no
    [lac vpn-connection]
    lns = xx.xx.32.43
    redial = yes
    redial timeout = 5
    require chap = yes
    require authentication = yes
    ppp debug = no
    pppoptfile = /etc/ppp/options.l2tpd
    require pap = no
    autodial = yes
    name = thename
  2. here is my: options.l2tpd

    idle 1800
    mtu 1410
    mru 1410
    connect-delay 5000
    name xxxxxx
    password xxxxx
  3. I know that the connection gets made because I get a ppp0 interface and an ip address:

    ppp0      Link encap:Point-to-Point Protocol  
              inet addr:  P-t-P:xx.xx.32.43  Mask:
              RX packets:5 errors:0 dropped:0 overruns:0 frame:0
              TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:3 
              RX bytes:98 (98.0 B)  TX bytes:110 (110.0 B)
  4. The ip address of the server that I need to hit is:, when I try to ping it using a ping command specific to that interface:

    ping -I ppp0

I end up getting this error: ping: sendmsg: No such device

  1. Thinking maybe it was some kind of subnet issue I connected to the vpn using multiple client clients simultaneously and got ip's such as, and to ping each of the clients from the other to the same issue: ping: sendmsg: No such device. With all the clients I get connected and ifconfig returns the right ip address.

The person administering the other networks swears that those ip addresses are up and running. I'm not sure how to proceed.. forgive a total linux newbie..

  1. Here is the output of ip ro show:

    default via xx.31.32.1 dev eth0 
    xx.xx.32.43 dev ppp0  proto kernel  scope link  src 
    xx.31.32.0/20 dev eth0  proto kernel  scope link  src xx.31.36.249
  • Check your routing table. With the tunnel up, run ip ro show and add the output to your question. – Andrew Domaszek Dec 29 '15 at 12:49

In summary it was routing issue, I needed to add a script in the /etc/ppp/ip-up.d folder, this script, called routes.sh would be run when the vpn/ppp interface came up.


route add -net netmask dev ppp0
route add -net netmask dev ppp0

Then I also needed to enable ipforwarding in sysctl.conf, the command: net.ipv4.ip_forward = 1

That was it.. set the routes when in the interface comes up, and enable forwarding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.