Can’t Ping other local ips on l2tp vpn connection, getting: ping: sendmsg: No such device

l2tpnetworkingpingvpnxl2tpd

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: 10.10.251.32, however when I attempt to I get this error: "ping: sendmsg: No such device". I try the ping with command: ping -I ppp0 10.10.251.32. I have tried connecting to the vpn from other machines, the ip address that I get assigned are for example: 10.10.2.163, or 10.10.2.120, or 10.10.2.114 all in the 10.10.2.xxx subnet,

  1. This is my xl2tpd.conf:

    [global]
    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

    ipcp-accept-local
    ipcp-accept-remote
    refuse-eap
    require-mschap-v2
    noccp
    noauth
    idle 1800
    mtu 1410
    mru 1410
    defaultroute
    usepeerdns
    debug
    lock
    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:10.10.2.115  P-t-P:xx.xx.32.43  Mask:255.255.255.255
              UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1410  Metric:1
              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: 10.10.251.32, when I try to ping it using a ping command specific to that interface:

    ping -I ppp0 10.10.251.32
    

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 10.10.2.120, 10.10.2.114 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 10.10.2.125 
    xx.31.32.0/20 dev eth0  proto kernel  scope link  src xx.31.36.249
    

Best Answer

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.

/etc/ppp/ip-up.d/route

#!/bin/bash
route add -net 10.10.251.32 netmask 255.255.255.255 dev ppp0
route add -net 10.10.247.1 netmask 255.255.255.255 dev ppp0
exit

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.