Difference between revisions of "Staging"
Jump to navigation
Jump to search
(Created page with "== Becoming your own dial-up ISP in 2019 == ==== Required hardware: ==== * A hardware modem (not a software modem/winmodem, must be the real deal) * A computer to install lin...") |
|||
| Line 25: | Line 25: | ||
==== Preparing the dial-in-server ==== | ==== Preparing the dial-in-server ==== | ||
| − | + | <ol> | |
| − | + | <li>Install Debian/Ubuntu/Raspbian per the usual methods (not covered here)</li> | |
| − | + | <li>Update to latest packages and reboot if required<br /></li> | |
| − | + | <pre> | |
| − | + | sudo apt-get update | |
| − | + | sudo apt-get upgrade | |
| − | + | sudo reboot</pre> | |
| − | In my case it presents as /dev/ttyUSB0 | + | <li>Connect USB to RS232 adaptor and confirm it shows up as /dev/ttyUSBXXX (<code>ls /dev/</code> to check) In my case it presents as <code>/dev/ttyUSB0</code><br /> |
| + | My serial adaptor is a "<code>ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adaptor</code>" <br /><br /> | ||
| + | Full lsusb output: | ||
| + | <pre> | ||
| + | user@debian:~# sudo lsusb -v | ||
| + | Bus 004 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter | ||
| + | Device Descriptor: | ||
| + | bLength 18 | ||
| + | bDescriptorType 1 | ||
| + | bcdUSB 1.10 | ||
| + | bDeviceClass 255 Vendor Specific Class | ||
| + | bDeviceSubClass 0 | ||
| + | bDeviceProtocol 0 | ||
| + | bMaxPacketSize0 8 | ||
| + | idVendor 0x1a86 QinHeng Electronics | ||
| + | idProduct 0x7523 HL-340 USB-Serial adapter | ||
| + | bcdDevice 2.54 | ||
| + | iManufacturer 0 | ||
| + | iProduct 2 USB2.0-Ser! | ||
| + | iSerial 0 | ||
| + | bNumConfigurations 1 | ||
| + | Configuration Descriptor: | ||
| + | bLength 9 | ||
| + | bDescriptorType 2 | ||
| + | wTotalLength 39 | ||
| + | bNumInterfaces 1 | ||
| + | bConfigurationValue 1 | ||
| + | iConfiguration 0 | ||
| + | bmAttributes 0x80 | ||
| + | (Bus Powered) | ||
| + | MaxPower 96mA | ||
| + | Interface Descriptor: | ||
| + | bLength 9 | ||
| + | bDescriptorType 4 | ||
| + | bInterfaceNumber 0 | ||
| + | bAlternateSetting 0 | ||
| + | bNumEndpoints 3 | ||
| + | bInterfaceClass 255 Vendor Specific Class | ||
| + | bInterfaceSubClass 1 | ||
| + | bInterfaceProtocol 2 | ||
| + | iInterface 0 | ||
| + | Endpoint Descriptor: | ||
| + | bLength 7 | ||
| + | bDescriptorType 5 | ||
| + | bEndpointAddress 0x82 EP 2 IN | ||
| + | bmAttributes 2 | ||
| + | Transfer Type Bulk | ||
| + | Synch Type None | ||
| + | Usage Type Data | ||
| + | wMaxPacketSize 0x0020 1x 32 bytes | ||
| + | bInterval 0 | ||
| + | Endpoint Descriptor: | ||
| + | bLength 7 | ||
| + | bDescriptorType 5 | ||
| + | bEndpointAddress 0x02 EP 2 OUT | ||
| + | bmAttributes 2 | ||
| + | Transfer Type Bulk | ||
| + | Synch Type None | ||
| + | Usage Type Data | ||
| + | wMaxPacketSize 0x0020 1x 32 bytes | ||
| + | bInterval 0 | ||
| + | Endpoint Descriptor: | ||
| + | bLength 7 | ||
| + | bDescriptorType 5 | ||
| + | bEndpointAddress 0x81 EP 1 IN | ||
| + | bmAttributes 3 | ||
| + | Transfer Type Interrupt | ||
| + | Synch Type None | ||
| + | Usage Type Data | ||
| + | wMaxPacketSize 0x0008 1x 8 bytes | ||
| + | bInterval 1 | ||
| + | Device Status: 0x0000 | ||
| + | (Bus Powered) | ||
| + | </pre> | ||
| + | </li> | ||
| + | <li>Install ppp (and getty if your distro doesn’t have it by default)<br /> | ||
| + | <pre>sudo apt-get install ppp</pre></li> | ||
| + | <li>Many of the old guides were written when inittab was still around but its 2019 and systemd has taken over.<br /> | ||
| + | We need to create a systemd service for mgetty </br> | ||
| + | Edit <code>/lib/systemd/system/mgetty.service</code> with your text editor of choice with elevated privileges (sudo) | ||
| + | <pre>[Unit] | ||
| + | Description=External Modem | ||
| + | Documentation=man:mgetty(8) | ||
| + | Requires=systemd-udev-settle.service | ||
| + | After=systemd-udev-settle.service | ||
| − | + | [Service] | |
| − | + | Type=simple | |
| − | + | ExecStart=/sbin/mgetty -x8 /dev/ttyUSB0 | |
| − | Install | + | Restart=always |
| − | + | PIDFile=/var/run/mgetty.pid.ttyUSB0 | |
| − | + | ||
| − | + | [Install] | |
| − | + | WantedBy=multi-user.target | |
| + | </pre> | ||
| + | </li> | ||
| + | </ol> | ||
Revision as of 04:17, 6 February 2019
Contents
Becoming your own dial-up ISP in 2019
Required hardware:
- A hardware modem (not a software modem/winmodem, must be the real deal)
- A computer to install linux on to talk to the a modem (Can be anything that a modern linux distribution will run on. Raspberry Pi, Pi clone, x86 machine, etc)
- A client device (windows 9x PC for example) with a modem
- Some form of PSTN to connect the two modems
The exact hardware I’ve used
- Generic x86_64 PC running Debian 9.5 x86_64
- Matrix “MX Modem” (more on this later)
- USB to RS232 serial adapter (DE-9) to connect to the modem (Must support hardware flow control)
- DE-9 to DB-25 serial adapter
- Linksys PAP2T analog telephone adapter (ATA)
- x86 based Windows 95 PC with a US Robotics Sportster 28800 ISA modem
Software used
- Debian 9.5 x86_64
- PPP
- getty
- Asterisk
Preparing the dial-in-server
- Install Debian/Ubuntu/Raspbian per the usual methods (not covered here)
- Update to latest packages and reboot if required
- Connect USB to RS232 adaptor and confirm it shows up as /dev/ttyUSBXXX (
ls /dev/to check) In my case it presents as/dev/ttyUSB0
My serial adaptor is a "ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adaptor"
Full lsusb output:user@debian:~# sudo lsusb -v Bus 004 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 255 Vendor Specific Class bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1a86 QinHeng Electronics idProduct 0x7523 HL-340 USB-Serial adapter bcdDevice 2.54 iManufacturer 0 iProduct 2 USB2.0-Ser! iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 96mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 1 bInterfaceProtocol 2 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 1 Device Status: 0x0000 (Bus Powered) - Install ppp (and getty if your distro doesn’t have it by default)
sudo apt-get install ppp
- Many of the old guides were written when inittab was still around but its 2019 and systemd has taken over.
We need to create a systemd service for mgetty
Edit/lib/systemd/system/mgetty.servicewith your text editor of choice with elevated privileges (sudo)[Unit] Description=External Modem Documentation=man:mgetty(8) Requires=systemd-udev-settle.service After=systemd-udev-settle.service [Service] Type=simple ExecStart=/sbin/mgetty -x8 /dev/ttyUSB0 Restart=always PIDFile=/var/run/mgetty.pid.ttyUSB0 [Install] WantedBy=multi-user.target
sudo apt-get update sudo apt-get upgrade sudo reboot