Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I've just bought a Raspberry Pi and have been trying to set it up as a VPN so I can use it while I travel. I've tried 3 different tutorials https://nxfifteen.me.uk/2015/02/07/raspberry-powered-openvpn-server/ and https://sys.jonaharagon.com being two of them (I can't remember the 3rd) but I keep hitting the same error.

I think I've followed each step properly, but when I get the keys created, download the ovpn file and import it into Open VPN Connect on my Android, it imports and then gets stuck at waiting for server.

I've tried forwarding the port to a computer running Wireshark and the router is definitely forwarding the port to it properly as Wireshark shows lots of OpenVPN packets coming in. I guess that means there is an issue either with...

1) The Pi not accepting the packets properly,
2) The Pi not responding to the packets properly
3) The router not outputting the packets properly
4) ???

It's my first time with a Raspberry Pi and using *nix so any advice would be great.

edit : I found https://bbs.archlinux.org/viewtopic.php?id=183818 and have the same issue that for some reason
systemctl start openvpn@server.service

needs to be run manually.

When I run that manually, it connects, and then it sends next to 0 data. Maybe a single page loads up and then nothing else.

Leading to 2 questions.
1) How do I make it so openvpn starts automatically
2) What's causing the data blockage? It's not a complete failure and sometimes loads a page but very rarely. OpenVPN Connect says it's been connected for the last 3 minutes and transferred about 100KB.

edit2 : Error message when I try to check status of openvpn is...

oot@raspberrypi:/home/pi# systemctl status openvpn@server.service -l
openvpn@server.service - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled)
Active: failed (Result: exit-code) since Tue 2016-07-26 00:00:11 BST; 54s ago
Process: 456 ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf (code=exited, status=1/FAILURE)

Jul 26 00:00:11 raspberrypi systemd[1]: openvpn@server.service: control process exited, code=exited status=1
Jul 26 00:00:11 raspberrypi systemd[1]: Failed to start OpenVPN connection to server.
Jul 26 00:00:11 raspberrypi systemd[1]: Unit openvpn@server.service entered failed state.


edit 3 I fixed the 2nd thing, for some reason iptables weren't sticking so I installed iptables-persistent and now that's good. I still can't work out how to get the openvpn status to start automatically.

Sad Panda fucked around with this message at 01:19 on Jul 26, 2016

Adbot
ADBOT LOVES YOU

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Warbird posted:

Where are you pop planning on traveling? I was planning to do the same when I was over in China, but was told that some places that crack down on VPN traffic would catch the sort of connection s that would involve a pi at your residence.

Well mine is primarily because I do online betting, and that wants me to be in the UK. The hope is this works for that.... if I can ever work out how to get OpenVPN to start automatically.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
A question, quite possibly stupid. I'm using Terminal on my Mac to SSH in.

I SSH in, authenticate as su, and do the following...

root@raspberrypi:/home/pi# reboot

That seems to kill the SSH connection (unsurprisingly) but then no matter how long I wait, I can not SSH in again, it just times out. To me, that suggests that it isn't rebooting properly. If I unplug it and plug it in again then I can SSH in as normal. Am I fundamentally failing to understand how Pis reboot? I'm coming from a Windows background so have no *nix experience.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

ElCondemn posted:

Hook a display up to it and see what the screen is saying

I restored to a previous Pi image and am trying again. Updating now following https://learn.pimoroni.com/tutorial/raspberry-pi/keeping-your-raspberry-pi-updated instructions. I was SSHd in last night and then it gave up mid SSH and wouldn't reconnect. Plugged it in the TV this afternoon and when I booted into startx I had to type the wifi password in again. Now it's updating again and I'm hoping that when it's done the SSH will work again.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I ended up wiping the Pi and using PiVPN to set OpenVPN up and then PiHole to get rid of ads when I'm connected to my VPN. My next 2 stupid questions...

1. When I reboot the pi, it turns on and usually displays the pi@raspberrypi:~$ message, but not always. If it doesn't I can simply press enter and it appears. Any idea on how to resolve that?

2. I've set up RealVNC so I can Cloud VNC in. That works fine, if I tell the Pi to boot to the desktop, but if it boots to CLI instead then it connects but the screen is blank and it doesn't show me the command line. Any ideas to resolve that?

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
My first time playing with Samba. I've set up Samba on my Pi, and am trying to access it through OS X. I don't know if this issue is OS X related or Samba related.

1. In Finder - Shared, I see my raspberrypi and a folder called films that I've setup. However, clicking on the films folder shows nothing. If I double click it it says "The operation can’t be completed because the original item for “Films” can’t be found."
2. If I use Connect to Server, put in smb://192.168.1.123 it tells me that I'm attempting to connect to the server, I tell it to connect as Guest, press connect, it shows me Films as a volume to mount, I select it and it says "There was a problem connecting to the server 192.168.1.123"

In smb.conf I have

code:
[Films]
comment = Films
path = /media/usb1/films
Browseable = yes
Writeable = Yes
Guest ok = yes
create mask = 0777
directory mask = 0777
read only = no
Any advice would be greatly appreciated. I've also posted this in the OS X thread.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Oben posted:

DietPi is great. You can have it install pi-hole and pretty much anything else automatically.

Just tried installing it. It looks like but gets stuck on setup at NTPD Running time sync update and will never get past it.

I'd gone through and adjusted the original install thing with such care too. Going to try wiping and just doing a default etch instead.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I've had a Pi for a while but this is the first time I've been fiddling with it more than just running PiVPN so have a number of questions.

1. I'm trying to run the following on my Pi, is this overloading it?

a) DietPi (just installed with the hope of minimising system load)
b) PiVPN routed through...
c) Pi-Hole
d) Transmission fed by...
e) Jackett + Radarr + Sonarr to feed...
f) Plex Media Server
g) RealVNC so I can remote in.

When I load up htop, the CPU load doens't seem bad but the RAM is pretty much around 800MB.


2. It has an old 320GB USB Ext4 formatted HDD attached to store things. DietPi has an option to transfer RootFS to my HDD, but that seems to involve formatting the HDD. If it would be much better I'll do it, but would love advice on how to not to lose everything I've done so far.

3. Would Deluge (or something else) be lighter than Transmission?

4. I installed LXDE. It was running just fine, but now won't autoboot and says startx can not be found. That is mainly so I can have a GUI option so I can do things that I'm not sure how to do in the terminal. Any reason why startx might just randomly vanish?

5. What's the purpose of Avahi-Daemon? It seems to start and I can't tell from what I read googling about why it is installed.

6. I get the following errors while starting in that it says FAILED instead of OK.

Failed to start Set console font and keymap
systemctl status console-setup.service for details


FAILED DietPi-Services start isc-dhcp-server

/DietPi/dietpi/login line 74 startx: command not found

Sad Panda fucked around with this message at 21:22 on Mar 3, 2018

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

eddiewalker posted:

Avahi is Bonjour. It’s especially awesome if you have Apple things.

Your ram usage probably isn’t concerning. https://www.linuxatemyram.com

Thanks! Nope the only thing I'm going to connect it to that isn't my USB HDD is an ethernet connection to the router and my Chromecast.

One concern is that it seems to be horrifically slow as in it seems like it's having problems connecting. The lightning bolt was appearing during boot earlier, which made no sense to me. I've tried both an iPad USB charger and one for an Android tablet, both rated at 2A.

I guess it might not like my hard drive (WD My Passport from years ago) so I'm going to order both the official Pi power supply and possibly a powered USB hub to plug the HD into. As that one is only 320GB, I'm tempted to get a 1-2TB to make this a proper media server if I can get this working reliably.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

GobiasIndustries posted:

Definitely buy a powered usb hub if you're plugging stuff like chromecasts and external hard drives into the pi. A 2a adapter is probably fine for just the pi (I think the official is 2.5a but w/e) but adding stuff, even keyboards, puts a big strain on it.

The Chromcast is downstairs on the TV. I meant that's the only thing it's interacting with :D

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
What can cause a local network Pi to be sluggish?

I try to SSH into it, using ssh username@ip.

It can take 30-90 seconds for it to ask me for my password and login which is ridiculous.

Just then I typed in sudo reboot, and it took more than 10 seconds to get the message saying the connection was closed by remote host.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

GobiasIndustries posted:

What kind of pi, and how's it connected to the network (ethernet/wifi)?

Pi 3 model B.

It is plugged directly into the router. I'm on my laptop connected by WiFi.

A few minutes ago I started this. It hasn't yet finished.

code:
sudo apt-get update
Get:1 [url]http://download.mono-project.com/repo/debian[/url] stretch InRelease [5863 B]
Hit:2 [url]http://dev2day.de/pms[/url] stretch InRelease       
Get:3 [url]http://download.mono-project.com/repo/debian[/url] stretch/main armhf Packages [48.6 kB]
Get:4 [url]https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian[/url] stretch InRelease [15.0 kB]
Get:5 [url]https://archive.raspberrypi.org/debian[/url] stretch InRelease [25.3 kB]
Hit:6 [url]https://apt.sonarr.tv[/url] master InRelease                
0% [6 InRelease gpgv 13.3 kB]                                                  

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
Thanks I'll give that a go.

One other thing, and something that might be related, is that I've just got a powered USB hub for the first time. This is so I can use my HDD and not overwhelm my Pi. A bit of a Google suggested that the correct order is ...
1) Plug hard drive into USB hub
2) Power up USB hub
3) Plug USB hub into Pi
4) Power up Pi

If I do that, at step 2 the light comes on and the hard drive whirrs up. When I hit step 4 however, the hard drive turns off and back on again. Am I wrong in thinking that's not ideal?

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
How do I troubleshoot network issues?
I've got my Pi connected by Cat-5 to my router. It is running things such as Pi-Hole, PiVPN, SSH, FTP, VNC and Plex.

If I try to access the websites for Pi-Hole or Plex, they timeout ("The server where this page is located isn't responding").
The same happens with SSH - "ssh: connect to host 192.168.1.100 port 223: Operation timed out".
And FTP - "Connection timed out or server hung up. The server you are connecting to may be configured to limit the number of connections you are allowed to make."

Bizarrely, I can still connect to the VPN just fine.

If I'm on the Pi, and type in netstat -lptn, it shows plenty of ports that are listening. For example
code:
tcp     0     0    127.0.0.1:4711       0.0.0.0*    Listen       1541/pihole-FTL
I can't think of what has changed, and it's rather frustrating.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

xzzy posted:

Check iptables (iptables -nL)? It reads to me like something shut down outside access.

iptables -nL

reports...

code:
Chain INPUT (policy ACCEPT)
target      prot         opt           source             destination
Chain FORWARD and Chain OUTPUT are identical - no entries.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I have an installation of DietPi. On top of that...


LXDE
RealVNC Server
Plex Media Server
qBitTorrent
Sonarr
Radarr
Jackett
Fail2Ban
Pi-hole
ProFTP
PiVPN


On the Pi itself, the internet works just fine.

fail2ban-client status dropbear + sshd

Both say total banned 0.


edit - Bizarre. Rebooting the router fixed it.

Sad Panda fucked around with this message at 19:42 on Mar 19, 2018

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
What's the best thing to do when packages won't update?

code:
dietpi@DietPi:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mono-roslyn (5.10.1.4-0xamarin1+raspbian9b1) ...

It has been sat like that for about the last 30 minutes. I've tried this a couple of times and it does the same thing each time. If I ctrl-c out of it, then the following happens..


code:
dietpi@DietPi:~$ sudo dpkg --configure -a
Setting up mono-roslyn (5.10.1.4-0xamarin1+raspbian9b1) ...
^Cdpkg: error processing package mono-roslyn (--configure):
 subprocess installed post-installation script was interrupted
dpkg: dependency problems prevent configuration of mono-devel:
 mono-devel depends on mono-roslyn (= 5.10.1.4-0xamarin1+raspbian9b1); however:
  Package mono-roslyn is not configured yet.

dpkg: error processing package mono-devel (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mono-roslyn
 mono-devel

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Sad Panda posted:

What's the best thing to do when packages won't update?

code:
dietpi@DietPi:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mono-roslyn (5.10.1.4-0xamarin1+raspbian9b1) ...

It has been sat like that for about the last 30 minutes. I've tried this a couple of times and it does the same thing each time. If I ctrl-c out of it, then the following happens..


code:
dietpi@DietPi:~$ sudo dpkg --configure -a
Setting up mono-roslyn (5.10.1.4-0xamarin1+raspbian9b1) ...
^Cdpkg: error processing package mono-roslyn (--configure):
 subprocess installed post-installation script was interrupted
dpkg: dependency problems prevent configuration of mono-devel:
 mono-devel depends on mono-roslyn (= 5.10.1.4-0xamarin1+raspbian9b1); however:
  Package mono-roslyn is not configured yet.

dpkg: error processing package mono-devel (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mono-roslyn
 mono-devel

2 hours later it finally timed out.

code:
Setting up mono-roslyn (5.10.1.4-0xamarin1+raspbian9b1) ...
Setting up mono-devel (5.10.1.4-0xamarin1+raspbian9b1) ...
W: Could not open file /var/log/apt/eipp.log.xz - open (12: Cannot allocate memory)
W: Could not open file '/var/log/apt/eipp.log.xz' - EIPP::OrderInstall (12: Cannot allocate memory)
W: APT had planned for dpkg to do more than it reported back (3 vs 7).
   Affected packages: mono-roslyn:armhf

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

fishmech posted:

Don't bother torrenting on a Pi. The transfer limitations make it suck.

Mine seems fine. Downloads at 5MB/s which is most of my connection.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Eletriarnation posted:

Torrenting is fine on a Pi if you are OK with being limited to Fast Ethernet speeds not just while downloading but also while transferring off files. I got tired of waiting and eventually migrated to a PC so I could get SATA and gigabit Ethernet.

It would probably also work great if you already have a NAS with gigabit and just have the Pi automatically clone over finished downloads before you need them.

I've got it going with Plex and it streams well enough for what I need.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
Raspberry Pi v3b running DietPi 6.9. Things run on it just fine (I have Plex, PiHole, Sonarr qBittorrent, VNC, Radarr + Jacket on it) but it seems to want nothing to do with my laptop (192.168.1.10). I can connect to VNC and all the webbased things on my phone but if I run VNC Viewer on my laptop it won't work. I also am unable to SSH in with it.

It feels like my Pi has banned my laptop somehow. Where?

I've tried
sudo iptables -L -n

but the Chain INPUT, Chain FORWARD and Chain OUTPUT are all blank.

I've got fail2ban setup, but fail2ban-client status says I have 2 jails that are both empty.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Professor of Cats posted:

Thanks! So far we haven't died.... yet. :)


Can you ping the pi from your PC on your local network? Vise versa?
E: accidentally a word

I couldn't ping it no. Now that I changed my fixed IP from .10 to .154 I can access again so I'm assuming there's an IP ban on my Pi against .10 but no idea what triggered or, or where it is.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Professor of Cats posted:

Maybe something else on the network had the same ip?
Disclaimer: Definitely not a networking expert

I'd be very surprised. It was the fixed IP my router has been giving me for a while.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

DizzyBum posted:

Very strange. Glad you got this resolved already.

How's the Pi handling your Plex transcoding? I would love to have a Pi serve media from a NAS, but I'm afraid it would catch fire. ...Though to be fair, I did experiment with Moonlight (Steam streaming) and it was able to push 1080p with no noticeable issues.

I mean it's resolved in that 192.168.1.154 works fine. I'm pretty sure if I went back to .1.10 then it'd not respond again.

I set it so it just streams (and watch it using my Chromecast) rather than attempts to do anything to do the media. I'd say 90% of what I have is 720p, but I think the 1080p I've tried worked fine once I got my internet sorted. The WiFi reception where my Chromecast is located wasn't great so I fixed that and it streams without issue.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I'm using my Pi 3B with DietPi installed on it (directly connected to router with Cat-5) to serve Plex as well as some other things. I use my phone to access Plex and send it to my TV via Chromecast. The problem is, that quite regularly it'll give up streaming until I reboot the Pi.

What's the best way to work out what is causing the stalling? I'm pretty sure it is the Pi itself, rather than the Chromecast, as for example last night when Plex was stalling I tried to connect to my VPN through my phone and it took a very long time to do so.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

mod sassinator posted:

I'd be leery of running Plex on a Pi as it's so slow of a processor. At the very least be absolutely sure Plex doesn't have to do any transcoding as the Pi will be ridiculously slow at it (remember the CPU is about as fast as a computer from the early 2000's). I remember using Plex long ago and and it seemed to be very happy to try transcoding everything so it might be doing it without you realizing.

I thought I'd turned off transcoding, but I'm not sure if it really has done so. Would Kodi or Emby be a better option for not transcoding?

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
I tried DietPi and it seemed to work just fine. Not sure if it's lighter than Raspbian but had the advantage of having a setup for lots of popular things.

Adbot
ADBOT LOVES YOU

Sad Panda
Sep 22, 2004

I'm a Sad Panda.

Warbird posted:

Looks like it’s an IPv6 address. The problem with xxx.xxx.x.xxx is that you only get so many possible combinations so IPv6 went ham with the side effect of baking a pita to read/remember.


Has anyone taken a shot at USB boot for a pi? I saw that they’ve enabled it and I’ve been thinking about trying it out on my Pi4s.

Yeah fe80 is the start of an IPv6 address.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply