While setting up my raspberry pi with apache2, shh and more at a new address I've encountered a problem.
My setup consists of a router (provided by my ISP, Sagemcom F@ST 3890) with port forwarding 80, 443 and 22 to my RPI's static local IP, ethernet connection. Everything runs smoothly for a while. I'm able to connect via HTTP, HTTPS and SSH through my domain pointing to my static remote IP. After about 10 hours it does, however, start to misbehave. If I do a `sudo reboot` on the RPI the setup works fine for about 10 hours.
- When checking ports through canyouseeme.org all previously open ports seem to have closed.
Error: I could not see your service on xxx.xxx.xx.xx on port (80/443/22) Reason: Connection timed out
- The apache server is still running and can be accessed through its
local IP. Same goes for ssh.
sudo nmap localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2018-05-24 14:34 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00049s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
631/tcp open ipp
3306/tcp open mysql
Apache2 and SSH are listening on their ports.
regnar@wserver:~$ sudo lsof -iTCP -sTCP:LISTEN -P
[sudo] password for regnar:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1162 root 3u IPv4 12110 0t0 TCP *:22 (LISTEN)
sshd 1162 root 4u IPv6 12112 0t0 TCP *:22 (LISTEN)
vsftpd 1171 root 3u IPv6 14735 0t0 TCP *:21 (LISTEN)
mysqld 1175 mysql 16u IPv4 15391 0t0 TCP localhost:3306 (LISTEN)
apache2 1233 root 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 1233 root 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
master 1491 root 12u IPv4 13109 0t0 TCP localhost:25 (LISTEN)
master 1491 root 13u IPv6 13110 0t0 TCP ip6-localhost:25 (LISTEN)
smbd 1498 root 34u IPv6 15584 0t0 TCP *:445 (LISTEN)
smbd 1498 root 35u IPv6 15585 0t0 TCP *:139 (LISTEN)
smbd 1498 root 36u IPv4 15586 0t0 TCP *:445 (LISTEN)
smbd 1498 root 37u IPv4 15587 0t0 TCP *:139 (LISTEN)
apache2 11103 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11103 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11104 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11104 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11105 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11105 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11106 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11106 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11107 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11107 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
cupsd 15513 root 10u IPv6 107704 0t0 TCP ip6-localhost:631 (LISTEN)
cupsd 15513 root 11u IPv4 107705 0t0 TCP localhost:631 (LISTEN)
UFW shouldn't be blocking the incoming connections. I've tried
disabling it as well.
regnar@wserver:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
Samba ALLOW Anywhere
Apache ALLOW Anywhere
Apache Full ALLOW Anywhere
Apache Secure ALLOW Anywhere
OpenSSH ALLOW Anywhere
Postfix ALLOW Anywhere
Samba (v6) ALLOW Anywhere (v6)
Apache (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW Anywhere (v6)
Apache Secure (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
Postfix (v6) ALLOW Anywhere (v6)
- I CAN ping my domain / remote IP from outside but I can't connect
through HTTP, HTTPS or SSH.
- I have tried restarting the router
- I have tried using another local IP
The setup (with a different router and different ISP) has been working for a long period at my previous address, but with the new connection / router the small setup seems to be having some trouble.
Anyone out there got a possible solution?
Kind Regards
My setup consists of a router (provided by my ISP, Sagemcom F@ST 3890) with port forwarding 80, 443 and 22 to my RPI's static local IP, ethernet connection. Everything runs smoothly for a while. I'm able to connect via HTTP, HTTPS and SSH through my domain pointing to my static remote IP. After about 10 hours it does, however, start to misbehave. If I do a `sudo reboot` on the RPI the setup works fine for about 10 hours.
- When checking ports through canyouseeme.org all previously open ports seem to have closed.
Error: I could not see your service on xxx.xxx.xx.xx on port (80/443/22) Reason: Connection timed out
- The apache server is still running and can be accessed through its
local IP. Same goes for ssh.
sudo nmap localhost
Starting Nmap 7.01 ( https://nmap.org ) at 2018-05-24 14:34 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00049s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
631/tcp open ipp
3306/tcp open mysql
Apache2 and SSH are listening on their ports.
regnar@wserver:~$ sudo lsof -iTCP -sTCP:LISTEN -P
[sudo] password for regnar:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1162 root 3u IPv4 12110 0t0 TCP *:22 (LISTEN)
sshd 1162 root 4u IPv6 12112 0t0 TCP *:22 (LISTEN)
vsftpd 1171 root 3u IPv6 14735 0t0 TCP *:21 (LISTEN)
mysqld 1175 mysql 16u IPv4 15391 0t0 TCP localhost:3306 (LISTEN)
apache2 1233 root 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 1233 root 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
master 1491 root 12u IPv4 13109 0t0 TCP localhost:25 (LISTEN)
master 1491 root 13u IPv6 13110 0t0 TCP ip6-localhost:25 (LISTEN)
smbd 1498 root 34u IPv6 15584 0t0 TCP *:445 (LISTEN)
smbd 1498 root 35u IPv6 15585 0t0 TCP *:139 (LISTEN)
smbd 1498 root 36u IPv4 15586 0t0 TCP *:445 (LISTEN)
smbd 1498 root 37u IPv4 15587 0t0 TCP *:139 (LISTEN)
apache2 11103 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11103 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11104 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11104 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11105 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11105 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11106 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11106 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
apache2 11107 www-data 4u IPv6 12169 0t0 TCP *:80 (LISTEN)
apache2 11107 www-data 6u IPv6 12173 0t0 TCP *:443 (LISTEN)
cupsd 15513 root 10u IPv6 107704 0t0 TCP ip6-localhost:631 (LISTEN)
cupsd 15513 root 11u IPv4 107705 0t0 TCP localhost:631 (LISTEN)
UFW shouldn't be blocking the incoming connections. I've tried
disabling it as well.
regnar@wserver:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
Samba ALLOW Anywhere
Apache ALLOW Anywhere
Apache Full ALLOW Anywhere
Apache Secure ALLOW Anywhere
OpenSSH ALLOW Anywhere
Postfix ALLOW Anywhere
Samba (v6) ALLOW Anywhere (v6)
Apache (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW Anywhere (v6)
Apache Secure (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
Postfix (v6) ALLOW Anywhere (v6)
- I CAN ping my domain / remote IP from outside but I can't connect
through HTTP, HTTPS or SSH.
- I have tried restarting the router
- I have tried using another local IP
The setup (with a different router and different ISP) has been working for a long period at my previous address, but with the new connection / router the small setup seems to be having some trouble.
Anyone out there got a possible solution?
Kind Regards