OpenWrt Forum Archive

Topic: pptp on startup???

The content of this topic has been archived on 11 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,
I ve got an Asus WL500g deluxe with wr-rc3.
I build up an pptp-connection like the "PPTP-Howto" explain.
Ok. When I start these after I loged in via Telnet or ssh with
pptp call peername .... the tunnel comes up and everything works fine.
Whe I put tese start in the init.d-directory like
File S60vpnstart:
#!/bin/sh
#sleep 60
case $1 in
start)
        touch /tmp/resolv.conf
        echo "nameserver 172.16.0.2" >> /tmp/resolv.conf
        route add -net 172.16.0.0 netmask 255.255.255.0 gw 192.168.1.1
        /usr/sbin/pppd call ggew_tunnel1
;;
stop)
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac
exit $?

I see the tunnel comes up and when I logged into the router the internet-connection works fine but on my client nothing happens.
No ping outside, no nslookup....
What is wrong?
By the way the dnsmasq puts me into the resolv.conf-file :
seach lan
nameserver 192.168.1.100 (this is the IP of the router)

Where is my nameserver of the vpn-connection? In the resolv.conf-file (/tmp) I put "nameserver 172.16.0.1 ".
How I can get the right nameserver-ip into the resolv-file of the clients?

Thanks Kai-Uwe

kdeparade wrote:

Where is my nameserver of the vpn-connection? In the resolv.conf-file (/tmp) I put "nameserver 172.16.0.1 ".
How I can get the right nameserver-ip into the resolv-file of the clients?

Try to add the "usepeerdns" option to /etc/ppp/options.pptp. According to the pppd man page this should help.
Christian

Thx Christian,
The dns-entry is ok right now.
But is there anybody out there to solve the starting problem??

so it  seems to be an iptables problem (connection from the router but no connections from the lan).. what iptables configuration are you using?

Thx for your replay,
I used the iptables out of the box without changes.
Only in the ip-up-script I put 2 rules.

#!/bin/sh
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd

logfile=/var/log/ppp
echo "PPP-Gestartet " >> $logfile
echo "`date` $0 $1 $2 $3 $4 $5 $6" >> $logfile

case "$6" in
ggew_tunnel1)
   A="/usr/sbin/iptables -t filter -I FORWARD -o $1 -j ACCEPT"
   B="/usr/sbin/iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE"
   $A
   echo " $? $A" >> $logfile
   $B
   echo " $? $B" >> $logfile
   ;;
esac
exit 0

I want to put these into a script into the init.d directory like S45myrules but with the same result.
I hope you can give me answer.
greetings from germany Kai-Uwe

The discussion might have continued from here.