[Linux/Network] PPP/PAP Dial-Up server with VoIP and Raspberry Pi

OK, so for today’s relaxing session, I though I should setup a PPP/PAP Dial-up server using a Raspberry Pi 3 box.

So here’s the hardware:

  • Cisco SPA112 ATA connected to a Yeastar Asterisk Based PBX
  • AudioCodes MP114 ATA Connected to a Yeastar Asterisk Based PBX
  • US Robotics Courrier 56K V.Everything + ATEN USB to COM Adapter connected to the AudioCodes MP114 ATA
  • US Robotics USB Modem USR5637 connected to Cisco SPA112 ATA
  • Raspberry PI3 model B connected wired to a Mikrotik CRS326-24G-2S+ and from there to the Internet

So, installed Ubuntu 20.04 LTS (Focal) on a MicroSD card and installed it in the Raspberry PI3. Note that the default user/pass are: ubuntu/ubuntu and you are required to change the password after the 1st login.

  • Configured a static IP on the Pi box

  • after inserting the USR5637 USB Modem in the Pi box, run a dmesg command ad you’ll find the port used by your modem (in my case TTYACM0)

  • Install Minicom: apt install minicom
  • run minicom -s and select “Serial Port Setup”
  • In Minicom change the setting: A – Serial Device from the default to your device – in my case /dev/ttyACM0 (0 is Zero)
  • Save setup as dfl   in Minicom

To test, start Minicom and start issuing ATI Commands to the modem (e.g. ATI 3)

  • Exit Minicom – ALT-A + X

Now we know that the modem connected to the Raspberry Pi 3 is working.

On with the  PPP Server configuration

  • Install mgetty: sudo apt-get install ppp mgetty
  • Create a systemd service for mgetty – you need to create the file – nano /lib/systemd/system/mgetty.service and put the following inside:

  • configure mgetty using /etc/mgetty/mgetty.config. You can comment everything and append the following for the serial device:

  • enable mgetty service to start at system boot: sudo systemctl enable mgetty.service
  • start mgetty: sudo systemctl start mgetty.service
  • let’s now configure PPP by editing /etc/ppp/options then comment everything except the settings elow:

  • create a device option file by editing /etc/ppp/options.ttyACM0 – here you can define the IP class that your dial-in users will receive

  • Now let’s create the user we will use for PAP authentication:

  • set the password for the dial user: sudo passwd dial
  • edit the /etc/ppp/pap-secrets and append the following line:

The password for the dial user will be taken from the OS.

  • enable packet forwarding for IPv4 addresses by editing /etc/sysctl.conf

  • configure the firewall to allow traffic forwarding from the PPP interface to the LAN (the Internet): so create t a file called rc.local under /etc/ and put the following inside:

 

Now let’s configure a dial-up connection in Windows and be sure to check the “show terminal window” in the security settings:

  • Put the Dial-up client to dial the number of the USB Modem USR5637 connected to the PI and after a successful carrier connect, you should get something similar to the prompt below, where you will enter the user/pass for the dial user and after getting the PPP frames (weird characters at the bottom of the screenshot), click OK to start authenticating with PAP

Then you can check the dial-up connection properties and see that the assigned IP is in the range that we defined above in the /etc/ppp/options.ttyACM0 file.

And yes, you have Internet access (damn slow, but you have it 🙂 )

Hope you enjoyed this as much as I did!