#Ubuntu as #PPP #dialin server with a #modem

This post is also available in: Dutch

Imagine: You’re runing an Ubuntu box with a modem connected to it. You don’t want to use it for dialing out to the internet (that’s how it was done last millennium), but you want to set it up as a dial-in server. It’s strange, but most of the online manuals I found don’t cover this, so I will.

You need to configure a PPP dialin server and we’ll do exactly that in the next few steps:

  1. You need mgetty. Install mgetty by using the following command:

    sudo apt-get install mgetty

  2. Copy /etc/event.d/tty1 to /etc/event.d/ttyS0 (ttyS0 = COM1; ttyS1 = COM2 etc). The last line of /etc/ttyS0 contains a line that goes like:

    exec /sbin/getty 38400 tty1

    Change it, so it says:

    exec /sbin/mgetty -s 57600 -D /dev/ttyS0

  3. If you have an /etc/ppp/options, back it up by using the following command:

    sudo mv /etc/ppp/options /etc/ppp/options.bak

    and make sure /etc/ppp/options looks like this:

    lock
    10.0.0.1:10.0.0.2 #The first address is the address you can use to access your server and the second address is the one that is asigne to your PC after the connection comes up

  4. Make sure to create an /etc/ppp/options.ttyS0 with the following content:

    10.0.0.1:10.0.0.2

    That’s it. Nearly done.

  5. The last thing on our list is to define dialin users in /etc/ppp/pap-secrets. Remember: this file is (or should be) protected. Use:

    sudo nano -w /etc/ppp/pap-secrets

    to change it. Make sure it has the following line somewhere:

    user        *        password        *

    Example:

    johndoe        *        secret        *

Done! Let me know if it worked for you.