Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PPP or SLIP over serial line
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Fri Sep 23, 2016 1:12 pm    Post subject: PPP or SLIP over serial line Reply with quote

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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42583
Location: 56N 3W

PostPosted: Fri Sep 23, 2016 4:50 pm    Post subject: Reply with quote

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
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Fri Sep 23, 2016 6:14 pm    Post subject: Reply with quote

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.
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



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
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10156
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 23, 2016 6:37 pm    Post subject: Reply with quote

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
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42583
Location: 56N 3W

PostPosted: Fri Sep 23, 2016 8:01 pm    Post subject: Reply with quote

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.

Code:
$ 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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Fri Sep 23, 2016 8:11 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42583
Location: 56N 3W

PostPosted: Fri Sep 23, 2016 8:23 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sat Sep 24, 2016 4:05 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Mon Sep 26, 2016 1:18 pm    Post subject: Reply with quote

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.

You might like screen or tmux installed on Gentoo.


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

Thanks,
Snarksdad
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Mon Sep 26, 2016 2:14 pm    Post subject: Reply with quote

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.

You might like screen or tmux installed on Gentoo.


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

Thanks,
Snarksdad

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
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Wed Sep 28, 2016 1:28 pm    Post subject: Reply with quote

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.

You might like screen or tmux installed on Gentoo.


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

Thanks,
Snarksdad

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


OK. One last thing (on this topic anyway :-)), 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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42583
Location: 56N 3W

PostPosted: Wed Sep 28, 2016 4:08 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Thu Sep 29, 2016 8:09 pm    Post subject: Reply with quote

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.

There are at least two solutions.


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...
Code:


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
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42583
Location: 56N 3W

PostPosted: Thu Sep 29, 2016 8:28 pm    Post subject: Reply with quote

snarksdad,

Is it as simple as turning on ipv4 forwarding on the box that has the PPP interface and another interyace?
That's
Code:
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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Fri Sep 30, 2016 2:41 pm    Post subject: Reply with quote

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
Code:
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.


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
Back to top
View user's profile Send private message
snarksdad
n00b
n00b


Joined: 23 Sep 2016
Posts: 16

PostPosted: Fri Sep 30, 2016 3:28 pm    Post subject: Reply with quote

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
Code:
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.


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


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:
Code:

/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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum