# PPTP problem - No buffer space available



## Anti_Evil (Oct 8, 2013)

Dears,

I'm trying to configure my PPTP connection to our office VPN server. I've reviewed most available tutorials for configuring a PPTP client, so I installed pptpclient and configured ppp.conf:


```
[root@hadi-pc] ~# cat /etc/ppp/ppp.conf
myvpn:
 set authname USERNAME
 set authkey PASSWORD
 set timeout 0
 set ifaddr 0 0
 add default HISADDR
 alias enable yes
```

Then I tried to connect to the VPN server:
`pptp myvpn X.X.X.X`

Actually, I think the connection is ok and I've authenticated successfully, because I see a new interface called tun0 is created and the proper IP address is assigned to that interface. Then I tried to ping the VPN server, and other addresses but every time I get:

```
ping: No buffer space available
```
And seconds later, the PPTP connection will drop. It is also the ppp logs:


```
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: Using interface: tun0
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: deflink: Created in closed state
Oct  7 17:10:10 hadi-pc ppp[71881]: Warning: The alias command is deprecated
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: PPP Started (direct mode).
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: bundle: Establish
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: deflink: closed -> opening
Oct  7 17:10:10 hadi-pc ppp[71881]: Alert: deflink: Can't create /var/run/pts/5.if: No such file or directory
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: deflink: Connected!
Oct  7 17:10:10 hadi-pc ppp[71881]: Phase: deflink: opening -> carrier
Oct  7 17:10:11 hadi-pc ppp[71881]: Phase: deflink: /dev/pts/5: CD detected
Oct  7 17:10:11 hadi-pc ppp[71881]: Phase: deflink: carrier -> lcp
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: bundle: Authenticate
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: deflink: his = CHAP 0x81, mine = none
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: Chap Input: CHALLENGE (16 bytes from MikroTik)
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: Chap Output: RESPONSE (USERNAME)
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: Chap Input: SUCCESS (S=A8361BED743BEC8457184D3EDF9A453451C229A7)
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: deflink: lcp -> open
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: bundle: Network
Oct  7 17:10:13 hadi-pc ppp[71881]: Phase: Unknown protocol 0x8281 (unrecognised protocol)
Oct  7 17:10:13 hadi-pc ppp[71881]: Error: rt_Set: Cannot add a route with gateway 0.0.0.0
Oct  7 17:11:13 hadi-pc ppp[71881]: Phase: deflink: HDLC errors -> FCS: 0, ADDR: 0, COMD: 0, PROTO: 1
Oct  7 17:11:18 hadi-pc ppp[71881]: Phase: Signal 15, terminate.
Oct  7 17:11:18 hadi-pc ppp[71881]: Phase: Signal 15, terminate.
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: Caught signal 2, abort connection(s)
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: deflink: open -> lcp
Oct  7 17:11:19 hadi-pc ppp[71881]: Warning: 0.0.0.0: Change route failed: errno: No such process
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: bundle: Terminate
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: deflink: Disconnected!
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: deflink: Connect time: 69 secs: 654 octets in, 3946458768 octets out
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: deflink: 22 packets in, 6928601 packets out
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase:  total 57195064 bytes/sec, peak 62131405 bytes/sec on Mon Oct  7 17:10:58 2013
Oct  7 17:11:19 hadi-pc ppp[71881]: Alert: deflink: Can't remove /var/run/pts/5.if: No such file or directory
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: deflink: lcp -> closed
Oct  7 17:11:19 hadi-pc ppp[71881]: Warning: Delete route failed: 172.22.128.98: errno: Address already in use
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: bundle: Dead
Oct  7 17:11:19 hadi-pc ppp[71881]: Phase: PPP Terminated (normal).
```

/var/log/messages log:

```
Oct  7 17:10:08 hadi-pc pptp[71881]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Oct  7 17:10:08 hadi-pc pptp[71890]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Oct  7 17:10:08 hadi-pc pptp[71890]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Oct  7 17:10:08 hadi-pc pptp[71890]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Oct  7 17:10:09 hadi-pc pptp[71890]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Oct  7 17:10:09 hadi-pc pptp[71890]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Oct  7 17:10:09 hadi-pc pptp[71890]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 13975).
Oct  7 17:10:10 hadi-pc kernel: tun0: link state changed to UP
Oct  7 17:10:10 hadi-pc ppp[71881]: Warning: The alias command is deprecated
Oct  7 17:10:10 hadi-pc ppp[71881]: Alert: deflink: Can't create /var/run/pts/5.if: No such file or directory
Oct  7 17:10:13 hadi-pc ppp[71881]: Error: rt_Set: Cannot add a route with gateway 0.0.0.0
Oct  7 17:11:18 hadi-pc pptp[71890]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
Oct  7 17:11:18 hadi-pc pptp[71890]: anon log[callmgr_main:pptp_callmgr.c:258]: Closing connection (shutdown)
Oct  7 17:11:18 hadi-pc pptp[71890]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Oct  7 17:11:18 hadi-pc pptp[71890]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
Oct  7 17:11:18 hadi-pc pptp[71890]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Oct  7 17:11:19 hadi-pc ppp[71881]: Warning: 0.0.0.0: Change route failed: errno: No such process
Oct  7 17:11:19 hadi-pc ppp[71881]: Alert: deflink: Can't remove /var/run/pts/5.if: No such file or directory
Oct  7 17:11:19 hadi-pc ppp[71881]: Warning: Delete route failed: 172.22.128.98: errno: Address already in use
Oct  7 17:11:19 hadi-pc pptp[71931]: anon warn[decaps_hdlc:pptp_gre.c:204]: short read (0): No buffer space available
Oct  7 17:11:19 hadi-pc kernel: tun0: link state changed to DOWN
```


I've searched over net, and some guys were offered to expand the kern.ipc.nmbclusters system parameter, I've already tried that but the result still the same. Can anyone please help me?


----------



## SirDice (Oct 8, 2013)

On what version of FreeBSD? And are you running a custom kernel? Post the output of `uname -a`.


----------



## Anti_Evil (Oct 8, 2013)

Dear SirDice,

I'm using PCBSD9.2 RELEASE on my laptop:


```
[root@hadi-pc] /var/log# uname -a
FreeBSD hadi-pc 9.2-RELEASE-p8 FreeBSD 9.2-RELEASE-p8 #0: Mon Sep 23 16:26:45 UTC 2013     root@amd64-builder.pcbsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## SirDice (Oct 8, 2013)

Obligatory warning: [thread=7290]*PC-BSD* DesktopBSD FreeNAS NAS4Free m0N0WALL pfSense ArchBSD kFreeBSD JabirOS topics[/thread]

Make sure there isn't a firewall interfering. And I'm wondering about this one:

```
17:10:13 hadi-pc ppp[71881]: Phase: Unknown protocol 0x8281 (unrecognised protocol)
```

What's the VPN server running?


----------



## Anti_Evil (Oct 9, 2013)

Thanks a lot for reply,

I think the VPN server is "MikroTik". About the firewall, actually I'm pretty sure that all network devices (routers+firewall between PC and VPN server) have granted PC with all required access-list. 

But from the PCBSD box view, I'm not sure, it is what I see:


```
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
00400 deny ip from any to ::1
00500 deny ip from ::1 to any
00600 allow ipv6-icmp from :: to ff02::/16
00700 allow ipv6-icmp from fe80::/10 to fe80::/10
00800 allow ipv6-icmp from fe80::/10 to ff02::/16
00900 allow ipv6-icmp from any to any ip6 icmp6types 1
01000 allow ipv6-icmp from any to any ip6 icmp6types 2,135,136
65000 allow ip from any to any
65535 deny ip from any to any
```

Please be noted that this log is taken before running pptp.


----------



## SirDice (Oct 9, 2013)

I think you need to find out the specific VPN protocols this MicroTik supports. As far as I can tell there's a difference in what the VPN client wants and what the server provides.


----------



## Anti_Evil (Oct 9, 2013)

Thank you very much,
I'll study the current config of the VPN server, hopefully if I could find the solution I'll update back here.

Thanks again.


----------

