# Newbie VPN guide



## narcolepsy (Sep 7, 2009)

Hi folks, I've used freebsd for quite a while now, and have tried to educate myself into setting up a vpn connection to my workplace (tried pptpclient, didn't work. then installed mpd5 - found it a bit impenetrable)

Are there any simple guides out there to help me get this working, and which application would you suggest?

Thanks


----------



## DutchDaemon (Sep 7, 2009)

security/openvpn is not too difficult. There's adequate information in the client/server config files, and there are public docs at http://www.openvpn.net/index.php/open-source/documentation.html


----------



## aragon (Sep 7, 2009)

I think narcolepsy needs something that uses PPTP (as that's what his work uses).

mpd5 is the best in my limited experience.  Will an example config help you?


```
startup:
	set user admin admin admin
	set console self 127.0.0.1 5005
	set console open
	set web self 127.0.0.1 5006
	set web open

default:
	load work

work:
	create bundle static B1
	set bundle enable crypt-reqd
	set bundle enable compression
	set ccp yes mppc
	set mppc no e40 e56
	set mppc yes e128 stateless
	set ipcp ranges 0.0.0.0/0 0.0.0.0/0
	set ipcp enable req-pri-dns
	set iface route IPRANGE
	set iface enable nat tcpmssfix
	set nat enable same-ports unreg-only
	set nat disable incoming
	create link static L1 pptp
	set link action bundle B1
	set auth authname USERNAME
	set auth password PASSWORD
	set link max-redial 10
	set link mtu 1460
	set link keep-alive 20 75
	set pptp peer VPNSERVER
	set pptp disable windowing
```

IPRANGE = the LAN IP range at work (eg. 192.168.1.0/24)
USERNAME= your vpn username
PASSWORD= your vpn password
VPNSERVER= the public IP address of your work's PPTP server

After loading mpd5 with that config, enter http://127.0.0.1:5006/ into your browser, log in as "admin" password "admin" and you'll be shown a screen where you can click "open" to open the connection to your work's network.


----------



## SIFE (Jan 14, 2010)

i get this error :

```
[root@localhost /usr/local/etc/mpd5]# mpd5 mpd.conf
Multi-link PPP daemon for FreeBSD
 
process 42644 started, version 5.4 (root@localhost 03:36 14-Jan-2010)
MppcTestCap: can't create mppc node: No such file or directory
CONSOLE: listening on 127.0.0.1 5005
web: listening on 127.0.0.1 5006
Label 'mpd.conf' not found
can't read configuration for "mpd.conf"
process 42644 terminated
```


----------



## SirDice (Jan 14, 2010)

SIFE said:
			
		

> i get this error :
> 
> ```
> [root@localhost /usr/local/etc/mpd5]# mpd5 mpd.conf
> ```


If you've used the config above it'll be `# mpd5 work` (see the label in mpd.conf) or just `# mpd5` (the default label points to work).


----------



## SIFE (Jan 14, 2010)

now i get this :

```
Multi-link PPP daemon for FreeBSD
 
process 24867 started, version 5.4 (root@localhost 03:36 14-Jan-2010)
MppcTestCap: can't create mppc node: No such file or directory
CONSOLE: listening on 127.0.0.1 5005
web: listening on 127.0.0.1 5006
[B1] can't create iface node at ".:"->"temphook": No such file or directory 7
[B1] can't create netgraph interface
mpd.conf:12: Error in 'create bundle static B1': Bundle netgraph initialization failed
mpd.conf:13: Incorrect context for: 'set bundle enable crypt-reqd'
mpd.conf:14: Incorrect context for: 'set bundle enable compression'
mpd.conf:15: Incorrect context for: 'set ccp yes mppc'
mpd.conf:16: Incorrect context for: 'set mppc no e40 e56'
mpd.conf:17: Incorrect context for: 'set mppc yes e128 stateless'
mpd.conf:18: Incorrect context for: 'set ipcp ranges 0.0.0.0/0 0.0.0.0/0'
mpd.conf:19: Incorrect context for: 'set ipcp enable req-pri-dns'
mpd.conf:20: Incorrect context for: 'set iface route 192.168.1.0/24'
mpd.conf:21: Incorrect context for: 'set iface enable nat tcpmssfix'
caught fatal signal segv
fatal error, exiting
process 24867 terminated
```
i use the some configuration above .


----------



## mav@ (Jan 18, 2010)

That's very strange. What system version do you use, what kernel and do you have kernel modules built?


----------



## hranitel_y2k (Mar 23, 2011)

I have same problem after update Freebsd release from 8.1 to 8.2. PPP daemon also don't work. I connecting to my isp via pppoe (mpd used as pppoe client).
Here is mpd.log:

```
Mar 23 20:13:40 gate mpd: process 1230 started, version 5.5 (root@domain.local 18:31 12-Mar-2010)
Mar 23 20:13:40 gate mpd: MppcTestCap: can't create socket node: File exists
Mar 23 20:13:40 gate mpd: LinksInit(): can't create socket node: File exists
Mar 23 20:13:40 gate mpd: CcpsInit(): can't create socket node: File exists
Mar 23 20:13:40 gate mpd: EcpsInit(): can't create socket node: File exists
Mar 23 20:13:40 gate mpd: web: listening on 192.168.8.1 5006
Mar 23 20:13:40 gate mpd: [B1] can't create iface node at ".:"->"temphook": Bad file descriptor -1
Mar 23 20:13:40 gate mpd: [B1] can't create netgraph interface
Mar 23 20:13:40 gate mpd: mpd.conf:25: Error in 'create bundle static B1': Bundle netgraph initialization failed
Mar 23 20:13:40 gate mpd: mpd.conf:27: Incorrect context for: 'set iface enable tcpmssfix'
Mar 23 20:13:40 gate mpd: mpd.conf:28: Incorrect context for: 'set iface mtu 1492'
Mar 23 20:13:40 gate mpd: mpd.conf:29: Incorrect context for: 'set ipcp yes vjcomp'
Mar 23 20:13:40 gate mpd: mpd.conf:31: Incorrect context for: 'set ipcp ranges 0.0.0.0/0 0.0.0.0/0'
Mar 23 20:13:40 gate mpd: mpd.conf:32: Incorrect context for: 'set iface up-script /usr/local/etc/mpd5/link_up.sh'
Mar 23 20:13:40 gate mpd: [L1] Link: OPEN event
Mar 23 20:13:40 gate mpd: [L1] LCP: Open event
Mar 23 20:13:40 gate mpd: [L1] LCP: state change Initial --> Starting
Mar 23 20:13:40 gate mpd: [L1] LCP: LayerStart
Mar 23 20:13:40 gate mpd: [L1] can't create tee node at ".:"->"l0": Bad file descriptor
Mar 23 20:13:40 gate mpd: [fxp0] PPPoE: can't create ctrl socket: File exists
Mar 23 20:13:40 gate mpd: [L1] PPPoE: Error creating ng_pppoe node on fxp0:
Mar 23 20:13:40 gate mpd: [L1] PPPoE node for link is not initialized
Mar 23 20:13:40 gate mpd: [L1] Link: DOWN event
Mar 23 20:13:40 gate mpd: [L1] LCP: Down event
Mar 23 20:13:40 gate mpd: [L1] Link: reconnection attempt 1 in 2 seconds
Mar 23 20:13:42 gate mpd: [L1] Link: reconnection attempt 1
```


----------

