1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VPN Tunnel using ssh and pppd: Doesn't work?

Discussion in 'Tomato Firmware' started by ooglek, Jul 30, 2007.

  1. ooglek

    ooglek LI Guru Member

    Using a buffalo G54S with Tomato 1.07.1039.

    According to this document at O'Reilly I should be able to tunnel pppd through SSH. Both my mac and Tomato have pppd and ssh, so I figured it would be a no brainer.

    I also read this post on Engadget about how this guy got his tunnel working.

    I was able to get a tunnel working between a FreeBSD box and my Mac without issue using the following commands from my Mac (only issued commands to the FreeBSD box via SSH).

    Code:
    pppd pty "/usr/bin/ssh -t -e none -o 'BatchMode yes' user@freebsd.example.com sudo /usr/sbin/pppd passive" local noauth proxyarp 10.10.10.1:10.10.10.2
    route add -net 192.168.0.0 10.10.10.2 255.255.255.0
    
    192.168.0.0/24 is the network I want to access via the tunnel. 10.10.10.x is a throw-away network I'm using to create the tunnel. .1 is my local IP, .2 is the remote IP.

    If I do this on my FreeBSD box, boom, no problem. If I try this on the Tomato router, it fails. Adding some more commands to pppd, I was able to get this information out of it:

    Code:
    pppd updetach noauth passive pty "/usr/bin/ssh -t -e none -o 'BatchMode yes' root@tomato.example.com /usr/sbin/pppd nodetach notty noauth" local noauth proxyarp 10.10.10.1:10.10.10.2
    Mon Jul 30 16:07:29 2007 : set_up_tty, can't set controlling terminal: Operation not permitted
    Mon Jul 30 16:07:29 2007 : Using interface ppp0
    Mon Jul 30 16:07:29 2007 : Connect: ppp0 <--> /dev/ttyp4
    Mon Jul 30 16:07:46 2007 : write: No buffer space available
    Mon Jul 30 16:07:48 2007 : write: No buffer space available
    Mon Jul 30 16:07:49 2007 : write: No buffer space available
    Mon Jul 30 16:07:51 2007 : write: No buffer space available
    Mon Jul 30 16:07:52 2007 : write: No buffer space available
    
    Clearly there is some buffer attempting to be written, and since there is no writable space, it cannot write. I don't know WHAT or WHERE it is trying to write to, but I figure this is my problem. Any guesses?
     
  2. azeari

    azeari LI Guru Member

    ok another thing looks interesting here to me
    Mon Jul 30 16:07:29 2007 : set_up_tty, can't set controlling terminal: Operation not permitted

    -shrugs- maybe this has something to do with ur problem. also, you could check the free memory on the router to determine if that is the problem.

    If i remember correctly, the pppd included in the router is rather limited in functionality when compared with the full fledged linux or mac ones
     
  3. ooglek

    ooglek LI Guru Member

    No, the tty thing happens both when it works with another UNIX box, and when it doesn't to the Tomato Buffalo.

    My next guess is that the firewall/iptables is blocking some port, but I'm not yet sure how to open up the firewall fully to test to see if it works. I'll google iptables and see if I can figure it out.
     
  4. azeari

    azeari LI Guru Member

    iptables -A INPUT -i tun+ -j ACCEPT
    iptables -A FORWARD -i tun+ -j ACCEPT
    iptables -A INPUT -i tap+ -j ACCEPT
    iptables -A FORWARD -i tap+ -j ACCEPT
    iptables -A INPUT -i br0 -j ACCEPT
    iptables -A FORWARD -i br0 -j ACCEPT

    lol.. tts just ripped off my router's vpn firewall scripts :p pretty self-explainatory. though i still doubt tts the problem
     
  5. ooglek

    ooglek LI Guru Member

    Yeah, you are right, that's not my problem. If only I could figure out what pppd wanted to write, I could create it on the JFFS. Anyone know what file(s) pppd needs to write in order to do a tunnel?

    Code:
    Mon Aug  6 23:55:14 2007 : Using interface ppp0
    Mon Aug  6 23:55:14 2007 : Connect: ppp0 <--> /dev/ttyq0
    Mon Aug  6 23:55:31 2007 : write: No buffer space available
    Mon Aug  6 23:55:33 2007 : write: No buffer space available
    Mon Aug  6 23:55:34 2007 : write: No buffer space available
    Mon Aug  6 23:55:36 2007 : write: No buffer space available
    Mon Aug  6 23:55:37 2007 : write: No buffer space available
    Mon Aug  6 23:55:39 2007 : write: No buffer space available
    Mon Aug  6 23:55:40 2007 : write: No buffer space available
    Mon Aug  6 23:55:42 2007 : write: No buffer space available
    Mon Aug  6 23:55:43 2007 : write: No buffer space available
    Mon Aug  6 23:55:45 2007 : LCP: timeout sending Config-Requests
    Connection to tomato.example.com closed.
    
     

Share This Page