Dial UP and PPP server in modern Linux

This is really simple to do, at least in Debian Jessie.

Since the innittab file is gone, we setup mgetty as a service with systemd.

we create a service in /lib/systemd/system/mgetty.service

[Unit]
Description=Linea 1 Modem USB
Documentation=man:mgetty(8)
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service

[Service]
Type=simple
ExecStart=/sbin/mgetty -x0 -s 57600 /dev/ttyUSB0
Restart=always
PIDFile=/var/run/mgetty.pid.ttyUSB0

[Install]
WantedBy=multi-user.target

 

then, standard setup:

systemctl start mgetty.service

systemctl enable mgetty.service

and last mgetty config

/etc/mgetty/mgetty.config

debug 5
port ttyUSB0
data-only y
toggle-dtr n

 

Now, PPP, this is also really simple.

After we install PPP, we edit the /etc/ppp/options

debug
login
default-asyncmap
require-pap
proxyarp
ktune
ms-dns 192.168.32.1

then create a device option file

/etc/ppp/options.ttyUSB0

local
lock
nocrtscts
192.168.32.1:192.168.32.105
netmask 255.255.255.0
debug
noauth

then we create the user and configure secrets.

useradd -G dialout,dip,users -d /home/dial -g users -s /usr/sbin/pppd dial

i did change this user password to “dial”

now we need to create the pap-secrets so we can authenticate with ppp: /etc/ppp/pap-secrets

dial * dial *

 

and last, at least for now, you enable packet forwarding for IP4 editing /etc/sysctl.conf

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

Leave a Reply

Your email address will not be published. Required fields are marked *