# PPTP VPN problem after new baselayout + ppp [SOLVED]

## daviessm

Hi,

I've had my VPN connection working in Gentoo for ages but after updating PPP and baselayout the other day, the connection can never be established/sustained.

What's odd is that the connection is seemingly set up and working, I get an IP, then pppd receives SIGTERM 2 seconds after it's established..

```
Aug 18 22:52:48 A6EC2441 pppd[1327]: local  IP address 144.124.45.7

Aug 18 22:52:48 A6EC2441 pppd[1327]: remote IP address 144.124.45.1

Aug 18 22:52:48 A6EC2441 pppd[1345]: Script /etc/ppp/ip-up started (pid 1346)

Aug 18 22:52:48 A6EC2441 rc-scripts: WARNING:  net.ppp0 has started but is inactive

Aug 18 22:52:50 A6EC2441 rc-scripts: ERROR:  net.ppp0 is already stopping.

Aug 18 22:52:50 A6EC2441 pppd[1345]: Terminating on signal 15

Aug 18 22:52:50 A6EC2441 pppd[1345]: Connect time 0.1 minutes.

Aug 18 22:52:50 A6EC2441 pppd[1345]: Sent 0 bytes, received 0 bytes.
```

Between 22:52:48 and :50 I haven't typed anything in, so I don't understand why net.ppp0 should be stopping, let alone 'already' stopping!

Here's the code I have in /etc/conf.d/net relating to ppp0:

```
config_ppp0=( "ppp" )

link_ppp0="pty 'pptp vpn.aber.ac.uk --nolaunchpppd'"

username_ppp0='myUsername'

pppd_ppp0=(

        "debug"

#       "updetach"

        "lock"

        "noauth"

        "nobsdcomp"

        "nodeflate"

        "mtu 1400"

        "mru 1400"

        "refuse-eap"

        "holdoff 60"

        "persist"

        "require-mppe"

)
```

Can anyone help me to get this connection to stay alive? Thanks  :Smile: Last edited by daviessm on Mon Sep 04, 2006 11:27 am; edited 1 time in total

----------

## daviessm

bump

----------

## nichocouk

Hi Steev,

nice to see your post... I have more or less the same problem, trying to connect to the same vpn server!   :Laughing: 

Have you found a solution? I cannot find the proper settings to put in the conf.d/net file to get this net.ppp0 working again.

Atm the only way I found is to launch manually the connection with 

```
/usr/sbin/pppd lock persist holdoff 60 ipparam AberVPN linkname ppp0 call AberVPN noauth hide-password
```

By the way are you sure you need the "require-mppe" option? It's absent from all my config files and the connection is usually working well (e.g. with the above command).

nic

----------

## daviessm

Sorry, I haven't managed to get it working yet. It still gets as far as connecting and getting an IP address, then immediately hangs up for some reason.

I'll post back here if I ever get it working..

----------

## nichocouk

I got it working   :Razz: 

relevant part of /etc/conf.d/net

```
config_ppp0=( "ppp" )

link_ppp0="pty 'pptp AberVPN --nolaunchpppd'"   # PPP links over ssh, rsh, etc

username_ppp0='myprettyusername'

pppd_ppp0=(

        "lock"          # Specifies that pppd should create a UUCP-style lock file for

                        # the serial device to ensure exclusive access to the device.

        "persist"       # Do not exit after a connection is terminated; instead try

                        # to reopen the connection.

        "holdoff 60"    # Specifies how many seconds to wait before re-initiating

                        # the link after it terminates.

        "ipparam AberVPN" # Provides an extra parameter to ip-up and ip-down.

        "call AberVPN"  # Read additional options from the file /etc/ppp/peers/AberVPN

        "noauth"        # Do not require the peer to authenticate itself

        "hide-password" # When  logging the contents of PAP packets, this option

                        # causes pppd to exclude the password string from the log.

)

```

And my /etc/ppp/peers/AberVPN file looks like this:

```

pty "pptp vpn.aber.ac.uk --nolaunchpppd "

name myprettyusername

remotename AberVPN

file /etc/ppp/options.AberVPN

ipparam AberVPN

refuse-eap

persist

noauth

```

And this is my /etc/ppp/options.AberVPN file:

```

lock

noauth

nobsdcomp

nodeflate

mtu 1000

mru 1000

lcp-echo-failure 10

lcp-echo-interval 10

```

I presume many of these options are redundant, but since it works, I'm not going to bother!

FYI:

```
net-dialup/ppp-2.4.3-r16  USE="activefilter atm dhcp gtk pam radius -eap-tls -ipv6 -mppe-mppc"
```

And finally:

```
$ grep -i ppp /usr/src/linux/.config

CONFIG_PPP=y

# CONFIG_PPP_MULTILINK is not set

CONFIG_PPP_FILTER=y

CONFIG_PPP_ASYNC=m

CONFIG_PPP_SYNC_TTY=m

CONFIG_PPP_DEFLATE=m

CONFIG_PPP_BSDCOMP=m

CONFIG_PPP_MPPE=m

# CONFIG_PPPOE is not set

# CONFIG_PPPOATM is not set

```

I hope you'll manage to get it working!

----------

## daviessm

I tried copying in exactly what you put (obviously changing my username) and if anything it's now broken even more than it was before - previously I would connect, get an IP, then something would give the rc script or pppd a SIGTERM and it would hang up. Now it gets stuck after TermAck just sending lots of ConfReqs with no response from the server  :Sad: 

----------

## nichocouk

That's weird... Have you had a look at the pptpclient page to help you diagnose the problem?

I haven't got much more knowledge to help you there, I'm afraid... 

Just a question as I think of it: are you sure that net.ppp0 is a symlink to net.lo, and not a copy of an old net.lo?

----------

## daviessm

 *nichocouk wrote:*   

> Just a question as I think of it: are you sure that net.ppp0 is a symlink to net.lo, and not a copy of an old net.lo?

 Yeah I'm sure. Also I seem to have weird problems when I have two PPTP connections set up - if I bring one up then the other gets brought up too. I can't be bothered to get it working again at the moment, I'll have another bash at it once I've made a start on this essay..  :Wink: 

----------

## daviessm

I fixed it, it turns out I had some weird gibberish in my predown() and postup() functions that were playing silly beggars with pppd.

The /etc/conf.d/net code I used is:

```
config_ppp0=( "ppp" )

link_ppp0="pty 'pptp vpn.aber.ac.uk --nolaunchpppd'"

username_ppp0='xxxx'

pppd_ppp0=(

        "lock"

        "persist"

        "holdoff 60"

        "nobsdcomp"

        "nodeflate"

        "refuse-eap"

        "noauth"

        "hide-password"

        "mtu 1400"

        "mru 1400"

)
```

This now works alongside my other PPTP connection, and at the end of the file I have the predown() and postup() functions defined as..

```

predown() {

        # Remember to return 0 on success

        if [[ ${IFACE:0:3} == "eth" ]]; then

                einfo "Bringing down PPP links..."

                /etc/init.d/net.ppp0 stop

                /etc/init.d/net.ppp1 stop

        fi

        return 0

}

postup() {

        if [[ ${IFACE:0:3} == "eth" ]]; then

                einfo "Bringing up PPP links..."

                /etc/init.d/net.ppp0 restart

                /etc/init.d/net.ppp1 restart

        fi

        return 0

}
```

 Which seems to work very nicely as long as I only have one Ethernet interface up at any time.   :Smile: 

----------

