Feed on Posts or Comments

Familiar & Debian & Internet & Linux Daantje on 08 Jan 2005 03:54 pm

Serial PPP internet connection through my laptop

Here’s how I got an PPP connection trough my serial port. Before I can have internet on my iPAQ (with an familiar distro installed on it…) I had to compile a new kernel on my laptop with ‘PPP filtering’ enabled. You can find it under ‘Network Devices’ in ‘make menuconfig’. For IP portforwarding you’ll have to have some more stuff in your kernel you can find here. How to build a custom Debian kernel package is here. Also installed ‘ppp’ on my laptop with:

apt-get install ppp

Before we go on, I’ve got an internal network with a NetGear router, it’s IP number is 192.168.1.1 and it’s the internal gateway and DNS server of my laptop. When you don’t have the same setup, change the 192.168.1.1 into the IP number from the gateway (or DNS) from your access-provider.

Then I made a file ‘/etc/ppp/peers/ipaq‘ on my laptop, with this content:

-detach
noauth
nocrtscts
lock
local
ms-dns 192.168.1.1
user ppp
connect '/usr/sbin/chat -v -t3 ogin--ogin: ppp'
/dev/ttyS0
115200
192.168.0.1:192.168.0.2

Then edit the ‘/etc/modules.conf‘ on the iPAQ and add these lines to it:

alias /dev/ppp          ppp_generic
alias char-major-108    ppp_generic
alias tty-ldisc-3       ppp_async
alias tty-ldisc-14      ppp_synctty

Then add to ‘/etc/modules

ppp_async

Now reboot your iPAQ with the command ‘reboot’. Then kill your minicom, if it’s on… and then open the ppp connection to the iPAQ from your PC, on Debian you do that with

pon ipaq

When it works you’ll see this

Serial connection established.
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
Cannot determine ethernet address for proxy ARP
local  IP address 192.168.0.1
remote IP address 192.168.0.2

Now you can ssh to the iPAQ…

ssh root@192.168.0.2

With me the login takes a second or 10… So be patient, it’s a serial connection ;)

Now you want internet on your iPAQ trough your serial PPP connection. So when you’ve compiled IP portforwarding (see my howto) in your kernel, you do the following. Make a file ‘ipmasq.sh’ with the following contents:

#!/bin/sh
#Assuming external internet card is eth0, and IP is 192.168.1.2
# modprobe ipt_MASQUERADE;
#Uncomment line above when you didn't compile it into the kernel
iptables -F; iptables -t nat -F; iptables -t mangle -F;
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.1.2;
echo 1 > /proc/sys/net/ipv4/ip_forward;

Make the file executeable by doing:

chmod +x ipmasq.sh

Now start it as root

./ipmasq.sh

Okay, now you should be able to ping your gateway, in my case 192.168.1.1. When you’ve got a ping the ipmasq works. Now try to ping www.google.com, that should work now to!
Now you can upgrade your distro with

/root/postinst
ipkg update
ipkg upgrade
ipkg install less
ipkg list | less
ipkg install madplay

Have fun ;)

Trackback | Comments RSS Feed

Leave a Reply

You must be logged in to post a comment.