iBabajan / tomato-sdhc-vlan

Automatically exported from code.google.com/p/tomato-sdhc-vlan
0 stars 0 forks source link

K24: can't have more than one PPP daemon running #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Use PPPoE as connection to internet
2.Configure PPTP server and attempt client connection
3.Observe in logs error "pppd[2297]: unrecognized option 'local'"

What is the expected output? What do you see instead?

1) PPTP clients do not connect and work as expected.
2) pppd is not handling isolation of configuations for pppoe and pptp properly, 
and the 'local' setting is being incorrectly applied to the pptp usage of pppd 
as a result. 

What version of the product are you using? On what operating system?

-RP-PPPoE plugin version 3.10 compiled against pppd 2.4.5
-Tomato v1.28.0023 Teaman-VLAN-PPTPD ND VPN
-Image flashed tomato-WRT54G_WRT54GL-1.28.0023Teaman-VLAN-PPTPD-VPN

Please provide any additional information below.

See http://dd9e.blogspot.ca/2011/07/tomato-with-pptp.html

Original issue reported on code.google.com by gregwjac...@gmail.com on 8 Apr 2012 at 2:54

GoogleCodeExporter commented 8 years ago
Here is a dirty hack...

I enabled JFFS
Used sed/hex editor to replace all instances of /tmp/ppp with /tmp/vpn in a 
copy of the /usr/sbin/pppd binary.

Place a copy of this modified binary which will now look in /tmp/vpn hard coded 
into the folder /jffs/

On the routers init script, I have the following proof of concept:

sleep 60
mkdir /tmp/vpn
cp /tmp/ppp/* /tmp/vpn/
echo "ppp /jffs/pppd" >> pptpd.conf
killall pptpd
sleep 5
pptpd -c /tmp/pptpd/pptpd.conf -o /tmp/pptpd/options.pptpd -C 6

I can't seem edit the logic of the Firmware to more cleanly use this hack. So 
either you go this dual binary route, or you have to change the behavior of 
some logic etc.

This trick works, so it proves where the failure point is, same as it does with 
the prior linked URL. 

Let me know how I can help, or further test this, as I use PPPoE etc. I know 
several users who can assist. Feel free to contact me. 

Original comment by gregwjac...@gmail.com on 8 Apr 2012 at 4:04

GoogleCodeExporter commented 8 years ago
Copy of Patched Binary ;)

Tried using sed, it was messy. I just used Hex Fiend.app on the 'ol Mac and did 
an ASCII search replace on /tmp/ppp with /tmp/vpn

Original comment by gregwjac...@gmail.com on 8 Apr 2012 at 4:06

Attachments:

GoogleCodeExporter commented 8 years ago
Here you can see the system with an active connection up and its behavior...

 5429 root       516 S    pptpd -c /tmp/pptpd/pptpd.conf -o /tmp/pptpd/options.pptpd -C 
 5430 root       524 S    /usr/sbin/bcrelay -i br0 -o ppp[4-9].* -n
 5431 root       524 S    /usr/sbin/bcrelay -i ppp[4-9].* -o br0 -n
 5433 root       632 S    pptpd [my.ip.here.blanked:BB76 - 0000]
 5434 root      1040 S    /jffs/pppd local file /tmp/pptpd/options.pptpd 115200 192.168.1.1:192.168.1.201 ipparam my.ip.here.blanked

Any cleaner way I can at least tie in the workaround script?

Original comment by gregwjac...@gmail.com on 8 Apr 2012 at 4:08

GoogleCodeExporter commented 8 years ago
doh, made a mistake above with my copy paste init script...

sleep 60
mkdir /tmp/vpn
cp /tmp/ppp/* /tmp/vpn/
echo "ppp /jffs/pppd" >> /tmp/pptpd/pptpd.conf
killall pptpd
sleep 5
pptpd -c /tmp/pptpd/pptpd.conf -o /tmp/pptpd/options.pptpd -C 6

Original comment by gregwjac...@gmail.com on 8 Apr 2012 at 4:10

GoogleCodeExporter commented 8 years ago
Made some mistakes here ;)

logger PPTPd Quick Fix - Sleeping 60 seconds...
sleep 60
logger PPTPd Quick Fix - Patching pptpd configuration
echo "ppp /jffs/pppd" >> /tmp/pptpd/pptpd.conf
logger PPTPd Quick Fix - Copying pptpd to vpn conf dir
mkdir /tmp/vpn
cp /tmp/pptp/* /tmp/vpn/
logger PPTPd Quick Fix - stopping prior pptpd binaries
killall pptpd
killall bcrelay
sleep 5
logger PPTPd Quick Fix - starting pptpd with new configuration applied!
pptpd -c /tmp/pptpd/pptpd.conf -o /tmp/pptpd/options.pptpd -C 6 &

Bonus points, someone could alternatively just use sed, do inline patching of 
the binary and copy and run it from /tmp/vpn/ and refer to it there... no need 
to use JFFS etc. 

perhaps this just after the mkdir above? 

cp /usr/sbin/pppd /tmp/vpn/pppd
sed -i -e 's#/tmp/ppp/#/tmp/vpn/#' /tmp/vpn/pppd 

Now if I could just get iOS5.0 to just do the $*@&* DNS lookups with a private 
DNS host IP address GRRRRRRRRR

Original comment by gregwjac...@gmail.com on 8 Apr 2012 at 5:05

GoogleCodeExporter commented 8 years ago
This seems possibly 'restricted' to ND/K24 builds, since RT/K26 builds have 
merged/included this commit (from Jean-Yves Avenard, branch tomato-RT-jyavenard 
via branch Toastman-RT):
http://repo.or.cz/w/tomato.git/commit/82d98a546c763224b4b2b3da72ea4d29a2af9479

Original comment by augu...@bott.com.br on 9 Apr 2012 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by augu...@bott.com.br on 9 Apr 2012 at 6:29

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by augu...@bott.com.br on 15 Jun 2012 at 7:04