LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2017, 04:31 AM   #1
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Rep: Reputation: 13
Cool sshttp with pppoe


Hi, I'm trying to use sshttp with pppoe (mtu=1492, pppoe over eth0) e.g.:
sshttpd -n 4 -S 1022 -H 1443 -L 443 -l ${ppp0_ip} -U nobody -R /run/sshttpd
with my equivalent https://github.com/stealth/sshttp/blob/master/nf-setup using DEV=ppp0 instead of eth0 and 1022, 1443 ports I get the following behaviour:
- websites visited from browser hang
- ssh username@ppp0_ip hangs

When using this setup directly with eth0 (behind a router which connects to same ISP using same pppoe configuration + mtu=1500) everything works as expected (ssh username@eth0_ip, websites are accessible).

The exact mtu=1492 for ppp0 is mandatory otherwise no website works - found after many painful tests.
When using pppoe I bind sshd to ppp0_ip:1022 and nginx to ppp0_ip:1443 while when using eth0 directly I bind them to eth0_ip:1022 and eth0_ip:1443.

I guess sshttpd binary has nothing to do with the problem but only the iptables used by nf-setup pointed with the link above; may be those iptables change/reset the mtu to 1500 -> I guess this might be because the result seems very similar to when used mtu 1500 with pppoe (websites hang).

So what could really be the problem and the solution?

Last edited by adrhc; 04-11-2017 at 06:58 AM. Reason: improved eloquence
 
Old 04-12-2017, 03:36 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,842

Rep: Reputation: 160Reputation: 160
What's your distribution, Fedora, Ubuntu and so on?
 
Old 04-13-2017, 01:48 AM   #3
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Yeah, sorry, I forgot about it:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

uname -a
Linux adr-desktop 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
 
Old 04-13-2017, 02:48 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,842

Rep: Reputation: 160Reputation: 160
The listening port of ppp0 interface has to be different from eth0.
 
Old 04-14-2017, 02:11 AM   #5
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by nini09 View Post
The listening port of ppp0 interface has to be different from eth0.
I'm not sure I understand your point.
The binding is done by sshd for configured ports 22 (from its default config) and 1022 (added by me) - I'm not specifying the interface so it's bind everywhere it can. Nginx is doing its part binding only to ppp0_ip:1443 when using pppoe otherwise to eth0_ip:1443 when not using pppoe but only eth0.
 
Old 04-14-2017, 02:13 AM   #6
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Anyway I analyzed the syslog and seems that the eth0 is going to sleep while used by ppp0 witch in turn disconnects ppp0. I'm pretty sure this is the problem but till I'm totally clarified I'll let this thread open.
 
Old 04-15-2017, 07:02 AM   #7
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
But there is indeed a problem. When binding sshttp to ppp0_ip:443 then accessing it with https I get:
Code:
sshttp::loop::NS_Socket::bind_local::bind:Address already in use
Pretty clear (you could say), someone is using ppp0_ip:443 (the only port sshttp binds to).
Not quite so I would respond because then I stop sshttp and I bind nginx to ppp0_ip:443 and then I found my websites accessible on ppp0_ip:443.
 
Old 04-15-2017, 07:04 AM   #8
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Same is happening with sslh which yields instead:
Code:
bind:98:Address already in use
bind_peer:98:Address already in use
Both of them behave just fine with same setup when using eth0 behind a router connected with pppoe to internet.

Last edited by adrhc; 04-15-2017 at 07:07 AM.
 
Old 04-17-2017, 02:52 PM   #9
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,842

Rep: Reputation: 160Reputation: 160
IP Tables is set to redirect all traffic coming into the server on the ppp0 interface on port 80 and 443, to the listen ports specified for sshttpd for each interface (so port 80 goes to port 20081).
 
Old 04-18-2017, 01:09 AM   #10
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by nini09 View Post
IP Tables is set to redirect all traffic coming into the server on the ppp0 interface on port 80 and 443, to the listen ports specified for sshttpd for each interface (so port 80 goes to port 20081).
Technically I understand you are talking here about a redirect with iptables (not an issue for me).
But what's the purpose related to my question of this redirect?
 
Old 04-19-2017, 02:46 PM   #11
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,842

Rep: Reputation: 160Reputation: 160
Your issue is that websites visited from browser hang. The hang is caused by you are using same port for both ppp0 and eth0.
They have to use different port.
 
Old 04-20-2017, 01:33 AM   #12
adrhc
Member
 
Registered: Dec 2006
Location: Bucharest
Distribution: Ubuntu 16.04 LTS
Posts: 103

Original Poster
Rep: Reputation: 13
Quote:
Originally Posted by nini09 View Post
Your issue is that websites visited from browser hang. The hang is caused by you are using same port for both ppp0 and eth0.
They have to use different port.
I'm using ONLY ppp0 for binding port 443, you are wrong. When using ppp0 over eth0 I don't even get an ip for eth0 according to ifconfig so surely I can't use eth0.

After other test I came to the result below; first I start sshttp:
Code:
sshttpd -n 4 -S 1022 -H 1443 -L 443 -l ${ppp0_ip} -U nobody -R /run/sshttpd
I try to use ssh over 443 and I get the error:
Code:
sshttp :: loop:: NS_Socket::bind_local::bind:Address already in use
Then I stop sshttp and then I start nginx on ppp0_ip:443 and ppp0_ip:1080 and it works accessing it on ppp0_ip:443 (https://ppp0_ip/my-web-site-url).
I stop nginx then start again sshttp and again same
Code:
bind:Address already in use
error with port 443 again being used only by sshttp according to:
Code:
sudo watch 'netstat -eetlpnv | grep -P "(443|1443|444|1022|80)"'
PS: the ppp0 connection is fine - I can access the internet

Last edited by adrhc; 04-20-2017 at 01:35 AM.
 
  


Reply

Tags
ppp0, pppoe, ssh, ubuntu 16.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: SSH/HTTP(S) multiplexing with sshttp LXer Syndicated Linux News 0 03-01-2012 09:00 PM
ppp0 paul62 Mandriva 1 09-04-2005 01:58 AM
eth1 and ppp0, need to send UDP packets through ppp0 smhs Linux - Networking 2 07-12-2005 08:54 AM
ADSL-STATUS: linked to ppp0 but ppp0 seems to be down. mikkime23 Linux - Networking 1 01-01-2005 11:00 AM
Endless Loop: ppp0 Unregister Netdevice: waiting for ppp0 to be free. oberon-ken-obi Linux - Networking 1 07-20-2004 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration