# ppp won't start



## Ajax (Oct 4, 2010)

After upgrading to 8.1 (clean install on i386) ppp doesn't start after system boot.
In /etc/rc.conf lines are

```
ppp_enable="YES"
ppp_profile="ocap"
ppp_mode="ddial"
ppp_nat="YES"
```
Nothin in logs, it just doesn't start. But if I "ssh" after boot and manually run 
	
	



```
ppp -ddial ocap
```
 everything works fine. Does anyone met such problem? How did you solve it? Found some recommendations move to mpd but it's what happened to ppp than? :\


----------



## DutchDaemon (Oct 4, 2010)

See if [cmd=]dmesg -a[/cmd] or a verbose boot (menu option 5) give more detailed remarks/errors.


----------



## lme@ (Oct 5, 2010)

Look for errors in /var/log/ppp.log


----------



## Ajax (Oct 5, 2010)

```
Starting PPP profile:
 ocap
```
and

```
Starting natd.
Loading /lib/libalias_cuseeme.so
Loading /lib/libalias_ftp.so
Loading /lib/libalias_irc.so
Loading /lib/libalias_nbt.so
Loading /lib/libalias_pptp.so
Loading /lib/libalias_skinny.so
Loading /lib/libalias_smedia.so
natd:
unknown interface name tun0
```
are only records in verbose loading log.
/var/log/ppp.log is clean, no any record that correspond to the boot up time.
NATd doesn't start because there is no tun0 yet and this seems to be logical.
/etc/ppp/ppp.conf is below. And again - manual run `$ ppp -ddial ocap` gets it started.

```
default:
        set log Phase Chat LCP IPCP CCP tun command
        ident user-ppp VERSION
        accept lqr
        set lqrperiod 30

ocap:
        set log Warning Error
        set device PPPoE:xl0:<TAG>
        set authname <LOGIN>
        set authkey <PASSWORD>

        set cd 5
        set mru 1492
        set mtu 1492

        set timeout 180
        set redial random 0

        set dial
        set login
        add default HISADDR

        nat enable yes
        nat log yes
        nat same_ports yes
        nat unregistered_only yes

        nat port tcp <iIP>:<iPORT> <ePORT>
        ...
        ...
```


----------



## Ajax (Oct 5, 2010)

Oh, one more thing:
`$ /etc/rc.d/ppp onestart`
and
`$ /etc/rc.d/natd onestart`
also run both successfully (sure natd would run 5-7 seconds later, when tun0 will be up & running.


----------



## aragon (Oct 5, 2010)

Are you able to see the startup messages on the console?  The ppp startup script should emit "Starting PPP profile" during startup.


----------



## Ajax (Oct 6, 2010)

Yes, there is a message followed by profile name but ppp doesn't actually start or fail.


----------



## jb_fvwm2 (Oct 6, 2010)

```
set log local Phase Chat Connect LCP IPCP CCP CBCP tun command
```
Maybe try that in ppp.conf so more verbose errors are seen on the screen? (Maybe not, Unsure if /dev/tun is the pppd device, the parameters refer to stuff used by pppd rather than the client that uses the ppp.conf file, and other reasons why it might be irrelevant. The key words are "set log local" I think...)


----------



## Ajax (Oct 7, 2010)

Got it! Set /usr/local/bin/bash for root but bash can't be run while loading.


```
/libexec/ld-elf.so.1:  Shared object "libintl.so.9" not found, required by "bash"
```

Damn. Why that worked on 7.x and doesn't on 8.x...


----------



## aragon (Oct 8, 2010)

Your thread will serve as an example of why one should never change root's shell. 

(use toor instead)


----------



## Ajax (Oct 8, 2010)

Yep. But why that worked on 7.x and doesn't on 8.x That's a question.
Another problem arose. On 7.3 ppp was called with _ppp nat_ option and ppp was running nat automatically after tun0 was created. Now, under 8.1 /etc/rc.conf has same lines (_ppp_enable_, _ppp_nat_, _natd_enable_ etc.), but it seems that natd starts before tun0 is created and sure it fails.
Any ideas where to dig?


----------



## aragon (Oct 8, 2010)

You do not need natd if you are using ppp's nat.  It's only needed for non-ppp interfaces.

But if you want to dig, you probably need to edit the REQUIRES lines in the RC scripts in /etc/rc.d/ and then test with rcorder(8).


----------



## mlnclc (Jan 13, 2011)

First, don`t touch the user root and use sh shell, second the libraries are always strict and if u move sth
that doesn`t correspond,this link can be broken.

see the /etc/shells:


```
[root@ingsys.cl ~]# tail /etc/shells

/bin/sh
/bin/csh
/bin/tcsh
/usr/local/bin/bash  << bash located is /usr/local and its libraries in /usr/local/lib.
/usr/local/bin/rbash
```

So u can do this:

`cp /usr/local/lib/libintl.so.9 /lib/libintl.so.9`
`cp /usr/local/lib/libiconv.so.3 /lib/libiconv.so.3`


----------



## DutchDaemon (Jan 13, 2011)

Yes, it's always an excellent idea to mix port libraries with base system libraries. It encapsulates the FreeBSD philosophy so well.


----------



## JokerBoy (Jan 13, 2011)

```
unknown interface name tun0
```

are you using the GENERIC kernel or a custom one? 'cause i got the same error when i tried to run ppp without tun built in kernel.

and


```
set device PPPoE:xl0:<TAG>
```
should be 

```
set device PPPoE:xl1 # replace xl1 with your Ethernet device
```


----------



## mlnclc (Jan 13, 2011)

Yes iT's a Generic Kernel this version FreeBSD 7.3 STABLE.

look your Kernel and verify 


```
device          ppp             # Kernel PPP
device          tun             # Packet tunnel.
```

and another thing,verify your version

`# uname -a`


and if not, compile a new kernel with the corresponding device

`# make buildkernel KERNCONF=YOURKERNEL`
`# make buildinstall KERNCONF=YOURKERNEL`

most info in:

http://www.freebsd.org/doc/handbook/userppp.html
http://www.freebsd.org/doc/handbook/pppoe.html


----------



## loos (Jan 28, 2011)

As aragon stated, you don't need natd if you are using the ppp_nat functions.

But, if you want to use something like that you have to add it to /etc/ppp/ppp.linkup, so it will be called after the connection establishment (and so tun0 will be there with your new IP).

Please note that you need to add the command under the same 'label' you had used on ppp.conf.

Even if you play with rcorder(8) there are no guarantees, since you don't know exactly how much time the ppp would need to establish the connection.

Please check the ppp(8) man page for more details about ppp.linkup and ppp.linkdown.


----------

