0

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..

6
  • You pretty much don't have routing between your VPN tunnel and the internal network. VPN you're connecting to might have a LAN ip which VPN sees as its gateway while clients in the LAN might have another gateway, I assume. If you could add more detail as what's the dialing VPN LAN and an ipconfig or a PC over LAN.
    – AzkerM
    Commented Dec 29, 2015 at 10:54
  • Sorry still a bit of a linux / networking newbie so I didn't understand your reply. Do you mean that when my client connects its receives a different gateway that the other clients on that LAN might have? As for the details of the connection, all we got was a instructions to connect to the l2tp vpn, which were an ip address and the username and password of how to connect to the l2tp connection. Commented Dec 29, 2015 at 11:16
  • See, for an example: let's say your VPN is just a PC with LAN and a WAN. Also, the LAN side of the VPN can be on the same subnet as the clients are (which you are trying to connect). But if the clients gateway is a different IP on the same subnet, then they'll talk to that particular gateway where your VPN has not relationship to talk to from its LAN. This is where you need routing even though you're on the same network since VPN tunnel is considered a different subnet, as it indeed is.
    – AzkerM
    Commented Dec 29, 2015 at 12:56
  • ok thank you. I think i get it. so I need to check with the people administering the VPN that i'm connecting to, to make sure that they have set up routing between the VPN server and the rest of the local network that I'm trying to connect to? Am i getting you correctly? Commented Dec 29, 2015 at 13:13
  • Yes, you do. If my guess is right, its pretty much to with the routing. I had gone through the same issue setting-up my OpenVPN and figured out it was due this.
    – AzkerM
    Commented Dec 29, 2015 at 13:24

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .