# PPP or SLIP over serial line

## snarksdad

Hello Gentoo networking experts.

I have a situation where I am restricted from connecting my Gentoo box to the network but I do have a serial port. I have been using this for awhile but having a single shell into the box is really slowing me down and makes it very difficult to xfer binary files back and forth. 

I had a similar situation years ago on Solaris and remedied that with a PPP (or SLIP, I don't remember which) connection and this worked out fairly well.

I am trying to get the same thing working on Gentoo (custom release, custom kernel) to a Windows 7 box and am not having much luck on the Gentoo side. Web search is not finding me much on getting ppp working over a serial port but from bits and pieces from various threads  I enabled PPP in the kernel, rebuilt and installed it, emerged some ppp packages (a slow process with no network tap) and am now to the point where I am getting:

/etc/init.d/net.ppp0 start

 * Caching service dependencies ... [ ok ]

 * Bringing up interface ppp0

 *   ERROR: interface ppp0 does not exist

 *   Ensure that you have loaded the correct kernel module for your hardware

 * ERROR: net.ppp0 failed to start

The net startup script is testing for /sys/class/net/ppp0 which does not exist...How should this have been created?

Anybody ever actually made this work over a serial port before?

Any pointers appreciated...

Thanks,

Snarksdad

----------

## NeddySeagoon

snarksdad,

Welcome to Gentoo.

Once upon a time, everyone with a baseband modem (56k baud and below) used PPP over a serial link.

If you have a mobile data dongle, you still use it today.

The serial ports may not be real physical RS232 serial ports but they are still there. 

For binary transfers, there are solutions like Kermit (yes really named after the frog) X-modem, Y-modem and even Z-modem.

They all date from the early days of modems.  I'll confess to still owning a 300/300 baud Pace modem.

PPP is still used over Ethernet.

Going back to the old days, you need something to start PPP. traditionally this was a chat script.  The method is that you reach your ISP, authenticate, then both ends start PPP over the link.

The Linux Documentation Project is always worth a read.

You should be able to get a real serial port working at 115200 baud. Above 9600 baud you will need hardware flow control.

It will still be very slow, you may want to try sneakernet

----------

## snarksdad

 *NeddySeagoon wrote:*   

> snarksdad,
> 
> Welcome to Gentoo.
> 
> Once upon a time, everyone with a baseband modem (56k baud and below) used PPP over a serial link.
> ...

 

Ahh yes the good old days of 25 pin EIA RS232 cables - now we seem to get by with Tx,Rx and GND, maybe DTR for kicks.

I still have - dare I say it - a 300 baud acoustic coupler modem in a box in my attic.

Anywho - yes I enabled a getty on the port and have it running at 115200, accessed via putty on the windows box but as I said, that gives me one bash session - I would be so much happier with a bunch of ssh's over TCP or ppp in lieu thereof...even if they have to share 115200. I'm not needing humungous throughput.

I had gotten some pointers from tldp but had not seen the one you reference. However, that one starts out by referencing a ppp daemon "pppd" - I don't have a pppd on my system - I am trying to locate that now...

As far as sneakernet, things aren't  quite as bad as that. I just put the URL of the dist files in my phone, download to it  and mount my phone as a USB drive on the Gentoo box. Copy those files to /var/local/portage/distfiles and emerge seems to find them just fine.

Thanks for the pointers (and nostalgia)...

Snarksdad

----------

## John R. Graham

 *snarksdad wrote:*   

> I had gotten some pointers from tldp but had not seen the one you reference. However, that one starts out by referencing a ppp daemon "pppd" - I don't have a pppd on my system - I am trying to locate that now...

 That would be net-dialup/ppp, in all likelihood, available from Portage.

- John

----------

## NeddySeagoon

snarksdad,

Can't you tether your phone over usb?

My phone provides Ethernet over USB.  The kernel provides the usb0 interface and everything just works.

Well, until the lease runs out, then I get a link local address.

```
$ equery b pppd

 * Searching for pppd ... 

net-dialup/ppp-2.4.7-r2 (/usr/include/pppd)

net-dialup/ppp-2.4.7-r2 (/usr/sbin/pppd)

net-dialup/ppp-2.4.7-r2 (/usr/lib64/pppd)
```

John was spot on with net-dialup/ppp.

----------

## snarksdad

 *John R. Graham wrote:*   

>  *snarksdad wrote:*   I had gotten some pointers from tldp but had not seen the one you reference. However, that one starts out by referencing a ppp daemon "pppd" - I don't have a pppd on my system - I am trying to locate that now... That would be net-dialup/ppp, in all likelihood, available from Portage.
> 
> - John

 

Got the package I was missing and installed it. Again reconfigured the kernel and after a bit of trial and error got ppp working...

Yay!

So now I can ssh in from Cygwin shells on Windoze and have multiple ssh sessions and use scp to copy binaries...

However, all is not great as Windoze refuses to keep the 115200 rate setting and seems to drop to 19200 - which is pretty slow.

I'll work on that, but I don't know much about Windows networking...

Thanks to all who helped...

Snarksdad

----------

## NeddySeagoon

snarksdad,

You need hardware handshaking to go above 9600 baud without dropped characters.

Software handshake will only work for non binary transfers, since two of the binary symbols become the handshake.

You might like screen or tmux installed on Gentoo.

----------

## szatox

 *Quote:*   

> having a single shell into the box is really slowing me down

  Hold on, if you simply want more shells, you can use screen - it will let you run several terminals over a single connection.

Of course, if it's about actually connecting to the internet, screen is not going to be nearly enough

----------

## snarksdad

 *NeddySeagoon wrote:*   

> snarksdad,
> 
> You need hardware handshaking to go above 9600 baud without dropped characters.
> 
> Software handshake will only work for non binary transfers, since two of the binary symbols become the handshake.
> ...

 

Neddy,

I have hardware flow control enabled on both sides, but the windows modem config settings just revert to 19200...

Thanks,

Snarksdad

----------

## snarksdad

 *snarksdad wrote:*   

>  *NeddySeagoon wrote:*   snarksdad,
> 
> You need hardware handshaking to go above 9600 baud without dropped characters.
> 
> Software handshake will only work for non binary transfers, since two of the binary symbols become the handshake.
> ...

 

OK. I got it - Turns out you have to set the default baud rate on Windows in the device manager to keep it from falling back.

All good now...

Snarksdad

----------

## snarksdad

 *snarksdad wrote:*   

>  *snarksdad wrote:*    *NeddySeagoon wrote:*   snarksdad,
> 
> You need hardware handshaking to go above 9600 baud without dropped characters.
> 
> Software handshake will only work for non binary transfers, since two of the binary symbols become the handshake.
> ...

 

OK. One last thing (on this topic anyway  :Smile: ), not really Gentoo but PPP and Network related...

How do I set up routing so that my Windows box "knows" about the other nodes on the private LAN the PPP server is on?

I have router, 10.0.8.1, 2 Gentoo boxes 10.0.8.2 (PPP server), and 10.0.8.3, and windows box 10.0.8.4 on private LAN. The PPP serial line sets a 2nd network on another windows box as 10.0.8.5. So 10.0.8.5 can reach 10.0.8.2 but nothing else (directly) on that LAN. 

If I set the defaultroute on the Windows box to the PPP interface, then it can access the other nodes, but then I lose real Internet access on the 10.0.8.5 Windows box. I tried to add a route on the Windows box to let it just know about 10.0.8.3 behind 10.0.8.2 (really all I need) but it did not work (could not ping 10.0.8.3 from 10.0.8.5).

Routing has never been my strong suit --- Any help appreciated.

Thanks,

Snarksdad

----------

## NeddySeagoon

snarksdad,

A sketch with your network topology would really help here, showing the IP addresses for each node, the operating system and the PPP link.

Your best ASCII art in a code block or an image uploaded to an image site would be good.

There are at least two solutions.

----------

## snarksdad

 *NeddySeagoon wrote:*   

> snarksdad,
> 
> A sketch with your network topology would really help here, showing the IP addresses for each node, the operating system and the PPP link.
> 
> Your best ASCII art in a code block or an image uploaded to an image site would be good.
> ...

 

Dang. After creating an image with the topology I find our firewall is blocking me from uploading it to

any of the standard image hosts...

My ascii art is horrendous... 

```

LOCAL LAN

Router           10.0.8.1

Gentoo box 1 10.0.8.2 ------PPP Serial Link----Windows 7 box---13x.xxx.xxx.xxx (corporate network)

Gentoo box 2 10.0.8.3                          PPP ifc

Windows box 10.0.8.4                          10.0.8.5

```

That's pretty much it. Need a route from 10.0.8.5 PPP via 10.0.8.2 to 10.0.8.3....

Thanks,

Snarksdad

----------

## NeddySeagoon

snarksdad,

Is it as simple as turning on ipv4 forwarding on the box that has the PPP interface and another interyace?

That's 

```
echo "1" >/proc/sys/net/ipv4/ip_forward
```

Read the value before you do it.

It can be made permanent if it works.  That's on Linux. Windows must be able to do it too.

----------

## snarksdad

 *NeddySeagoon wrote:*   

> snarksdad,
> 
> Is it as simple as turning on ipv4 forwarding on the box that has the PPP interface and another interyace?
> 
> That's 
> ...

 

I set it on the 10.0.1.2 box that has PPP and the local LAN connection. It was 0 prior to changing. 

It did not seem to help. I restarted both the PPP and eth interface too.

I can see the ping requests getting to that box via tcpdump but it appears

it still does not know what to do with those packets...:

From 10.0.8.2 PPP link:

10:33:17.207038 IP 10.0.1.5 > 10.0.1.4: ICMP echo request, id 1, seq 149, length 40

10:33:21.859344 IP 10.0.1.5 > 10.0.1.4: ICMP echo request, id 1, seq 150, length 40

----------

## snarksdad

 *snarksdad wrote:*   

>  *NeddySeagoon wrote:*   snarksdad,
> 
> Is it as simple as turning on ipv4 forwarding on the box that has the PPP interface and another interyace?
> 
> That's 
> ...

 

OK. I got it. Need to start the pppd daemon with the proxyarp option:

proxyarp

              Add  an  entry to this system's ARP [Address Resolution Protocol] table with the IP address of the peer

              and the Ethernet address of this system.  This will have the effect of making the peer appear to  other

              systems to be on the local ethernet.

My startup line:

```

/usr/sbin/pppd debug -detach crtscts lock proxyarp 10.0.1.2:10.0.1.5 /dev/ttyS0 115200 passive

```

Everybody is happy now...

For the next person who hits this thread for PPP over serial link to windows 7, I setup Windows according to this:

https://mikebeach.org/2012/08/30/installing-and-configuring-a-ppp-null-modem-connection-on-windows-7/

and  setup Gentoo (after installing net-dialup/ppp) according to this http://www.tldp.org/HOWTO/PPP-HOWTO/direct.html (thanks Neddy)

Thanks,

Snarksdad

----------

