PDA

Bekijk de volledige versie : Customized firmware: how to edit PPTP connection options



MajleK
07-01-2004, 18:03
Hello everyone and thak you for making this happen. Telnet option is really helpful in my case. I've got here a PPTP connection to my provider and ASUS wouldn't work. Thanks to customized software and three days of getting started in linux (:) with INet, I believe I found the spoiler - PPTP connection simply is not completed. If you take a look at /init/rc.wan and /etc/ppp/ you will see that for pptp dynamic IP simply is not requested, then "manually" it is set to 10.64.64.64 while server is 10.112.112.112. I connected USB disk (I work under winXP) and downloaded everything from WL500g. Made some corrections and failed to replace /init/rc.wan. I know that step was probably foolish and all, but I don't really have experience in linux, I just tried to remount it as rw, failed again (no fstab). Now I'm thinking this possible only by building new firmware, but I don't have any means to do it. Tomorrow I will show the "toy" to my friend who will fix it, but I also want to know your opinion about this staff...

P.S. I also tried to kill the pppd process to connect manually, but it looks like watchdog watches it :-). So I'm really stuck and don't know what to do else...

MajleK
07-01-2004, 21:56
guys, I've done it (and I'm proud, really proud!)

What I've done:

1. Connected USB flash drive to USB and established ftp server with rw rights.

2. Created two files pap-secrets and chap-secrets with the same string inside:

<USER_NAME> * <USER_PASSWORD>

where user_name and user_password are login and password for VPN your ISP provided

3. Created file options :

user <USER_NAME>
usepeerdns
require-chap
ipcp-accept-local
ipcp-accept-remote
noproxyarp
noauth
logfile /mnt/usbfs/log/log.log
dump
debug
pty 'pptp 192.168.253.1 --nolaunchpppd'

4. Uploaded all the files onto ftp
5. Copied all the files into /etc/ppp

cp /mnt/usbfs/pap-secrets /etc/ppp/pap-secrets
cp /mnt/usbfs/chap-secrets /etc/ppp/chap-secrets
cp /mnt/usbfs/options /etc/ppp/options

6. ran pppd

pppd

7. Looked into the /log/log.log on ftp and couldn't believe my eyes. Yeeeesssssssss! It took me just three days.

MajleK
07-01-2004, 22:54
some corrections:

1. before running pppd I request IP from DHCP manually:

udhcpc -i eth1 -r 192.168.253.xxx

2. than, BEFORE copying options file run pppd which creates ppp1 interface. Ifter that I'm killing ppp0

ifconfig ppp0 down
kill 232

3. After copying files run pppd and make sure correct pptp connection is ppp0 because otherwise the routing table will be incorrect and LAN PCs won't see Internet.

And, the last piece of news: it works only till reboot, after that one's gotta redo it all over again, heh.

Oleg
08-01-2004, 09:44
Good job for linux starter. :) If you've corrected scripts (or better the diffs) against the original firmware then it's possible to incorporate everything to the custom one.
And a question out off topic: who is selling the wl500g in Russia? I've got mine from the Germany (thanks to my friends)...

MajleK
08-01-2004, 09:57
Good job for linux starter. If you've corrected scripts (or better the diffs) against the original firmware then it's possible to incorporate everything to the custom one.

Thanks a lot! I'm afraid there's still an awful lot to be done (for me). I'll try to get bootable linux CD and try to do it but cannot promise. Anyway it'll take me some time. (And I still don't know what are the diffs :-)


And a question out off topic: who is selling the wl500g in Russia? I've got mine from the Germany (thanks to my friends)...

Mine's come from US, thanks to friends again!

P.S. Today received my letter back from Asus - could not deliver... 1 month of expectations, heh.

Privet!

Technik
08-01-2004, 12:30
Originally posted by Oleg
And a question out off topic: who is selling the wl500g in Russia?
I think the only difference between B and G versions (hardware) is the miniPCI WiFi card. There's WL-120 miniPCI card in WL-500b and WL-120G in WL-500g. The WL-500b mainboard is signed as WL-500G. So if you have a chance to get the WL-120G somewhere, you could try to replace the original WL-120... ;)

Oleg
08-01-2004, 13:34
Ha, wl500b not available also. :) I've no idea why. wl300 units & pcmcia cards are available.

MajleK
08-01-2004, 23:11
Hello everyone, I think I finished the editing of PPTP connection script. Honestly I would appreciate anybody who knows Linux (a little bit) more than me checking it (udhcpc, firewall, and route especially). I don't know how to post it here properly so I'll try both to attach and (partly) quote it. Please also note that I never changed anything in PPPoE although it seems to me there'are mistakes, too. OK,

Here we go! /init/rc.wan quote started----


if [ "$x_ConnectionType" = "PPTP" ]; then

echo 1 > /proc/sys/net/ipv4/ip_dynaddr

/init/rc.syslog

if [ "$x_HostNameForISP" != "" ]; then
udhcpc -i $1 -p /var/run/udhcpc.pid -s /usr/share/udhcpc/default.script -H $x_HostNameForISP &
else
udhcpc -i $1 -p /var/run/udhcpc.pid -s /usr/share/udhcpc/default.script &
fi
echo "udhcpc" >> /etc/watchdog.conf

while route del default gw 0.0.0.0
do :
done

ln -sf /sbin/ip-up /etc/ppp/ip-up
ln -sf /sbin/ip-down /etc/ppp/ip-down
IDLE_T=864000000
[ "$IdleDisconnectTime" -gt 0 ] && IDLE_T=$IdleDisconnectTime

PPTP_OPT_FILE="/etc/ppp/options"
PPTP_PAP_FILE="/etc/ppp/pap-secrets"
PPTP_CHAP_FILE="/etc/ppp/chap-secrets"

echo "noauth" >> $PPTP_OPT_FILE
echo "user $UserName" >> $PPTP_OPT_FILE
echo "pty \'/sbin/pptp $x_ExternalGateway --nolaunchpppd\'" >> $PPTP_OPT_FILE
echo "defaultroute" >> $PPTP_OPT_FILE
echo "lcp-echo-interval 10" >> $PPTP_OPT_FILE
echo "lcp-echo-failure 3" >> $PPTP_OPT_FILE

echo "$UserName * $Password" > $PPTP_PAP_FILE
echo "$UserName * $Password" > $PPTP_CHAP_FILE

#/init/rc.pptp $x_ExternalGateway &
pppd file $PPTP_OPT_FILE

sleep 1s

#Invoke NAT and Firewall
. /etc/linuxigd/FirewallConfig

if [ "$DmzEnable" = 1 ] && [ "$DmzDevices" != None ]; then
/init/firewall $1 $WANIPAddress br0 $IPRouters br1 $DmzIP
else
/init/firewall $1 $WANIPAddress br0 $IPRouters
fi


# 2003/09/20 added by Joey for UPnP event
nvram set wan_proto=pppoe
nvram set wan_proto_ex=pppoe
nvram set wan_ifname=$1
nvram set wan_username=$UserName
nvram set wan_passwd=$Password
nvram set wan_idletime=$IDLE_T

echo "pppd" >> /etc/watchdog.conf

elif [ "$x_ConnectionType" = "PPPoE" ]; then

------ /init/rc.wan quote finished

Oleg
09-01-2004, 11:51
Ok, the main differences are the dhcp support & CHAP authentication. I will clean-up the patch & incorporate this to the firmware.

MajleK
10-01-2004, 14:11
Oleg, thx for the fix,

I tried it only today, Sat, at 13 o'clock
It connected ok (I set IP to static 0.0.0.0)
Now I'm heading for home and withing two hours will check how it is feeling. Won't be able to check anything tomorrow as my flight is 9 in the morning, sorry for that. Test will take place actively two weeks later and passively for the following two weeks as my wife will try it.

Thank you for all again, hope we will polish the product as Asus don't seem to be interested in it :-)