NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Mon Mar 27, 2017 4:10 pm

Doug,

Last night I rebooted my Pi and lost network contact with it. The new SSID on my Pi was broadcasting however, and though windows complained that the connection did not have internet access, I could connect to the RF with a wireless device. When I scanned the AP network, my Pi appeared with two IP's with two MAC add's, but I could not connect via SSH to either one.

This morning, I connected with a monitor via HDMI and a USB keyboard and added

Code: Select all

denyinterfaces eth0


to dhcpcd.conf

and

Code: Select all

netmask 24
address 192.168.3.14 
to /etc/network/interfaces, per your guidance.

I rebooted and reconnected the Pi to my router and was again able to connect via SSH after a reboot and gain web access via multiple wireless devices and surf the web.

However, I rebooted again and I've once more lost SSH access. I'm connected to the Pi AP, and my Pi appears on the network with an IP:
Capture IPSCAN.JPG
Capture IPSCAN.JPG (37.8 KiB) Viewed 2766 times

Now, however, it appears on wifi network of my router
Capture IPscanner 2.JPG
Capture IPscanner 2.JPG (37.16 KiB) Viewed 2766 times
My Pi seems to be sometimes appearing on the wifi network of my router and sometimes on its own AP network (its attached to the router via ethernet). Wherever it appears, it has the same IP (the one I assigned to wlan0 in the interfaces file?). I just rebooted once more and connected to the Pi AP, and my network scanner lists ALL devices attached to my router AND to my Pi. The SSID is always broadcasting, and I can always "connect" to it.


I rebooted and right now i have internet access when connected to the AP. However, if I place my cursor over the wifi connection icon in my system tray (Win 7), it seems to think I'm connected to two different signals: The SSID of my router an the SSID of my Pi AP.

Oy!

User avatar
DougieLawson
Posts: 37074
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi as VPN Router and Wireless Access Point. Possible??

Mon Mar 27, 2017 5:37 pm

Power down your RPi then reboot (or power cycle) your router. Power up your RPi in AP mode. Then run your experiments again.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Mon Mar 27, 2017 9:52 pm

DougieLawson wrote:Power down your RPi then reboot (or power cycle) your router. Power up your RPi in AP mode. Then run your experiments again.
Did that. It worked fine for a while. I started up the VPN and it continued to function, though I don't know know if all data was indeed passing through the tunnel. I left for about two hours, and when I came back, the AP was no longer issuing IP's (phone sat there "obtaining IP" for a while and finally gave up) and the connection in Win 7 is showing an " ! " again, and is passing no data.

Any ideas? :shock:

NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 2:47 am

When I connect to the SSID with my laptop, my Pi appears on the network.
Capture IPSCAN.JPG
Capture IPSCAN.JPG (40.22 KiB) Viewed 2729 times
However, I cannot connect to it via SSH with Putty or VNC.

When I run ipconfig on Laptop1 while connected to the Pi's SSID, I get the following
Capture ipconfig.JPG
Capture ipconfig.JPG (38.63 KiB) Viewed 2729 times

User avatar
DougieLawson
Posts: 37074
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 6:32 am

What ports are open on your RPi? ssh isn't enabled by default now.

sudo netstat -tlnp # have a look at what services are running
sudo systemctl enable ssh
sudo systemctl start ssh
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.


NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 3:18 pm

[quote="DougieLawson"]What ports are open on your RPi? ssh isn't enabled by default now.

I enabled SSH when I re-flashed the fresh Jessie image at the beginning of this thread, by adding file "ssh" to boot sector. I've been working headless, except for when I've been unable to access via SSH, for whatever reason.

sudo netstat -tlnp # have a look at what services are running:

Here ya go:
Running services.jpg
Running services.jpg (50.63 KiB) Viewed 2685 times

NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 3:25 pm

RaspberryPi2 wrote:Adafruit has a very useful tutorial:
https://learn.adafruit.com/setting-up-a ... t/overview
Thanks!

If I understand this correctly, with a console cable, I can access my Pi without an HDMI monitor or keyboard. In other words, I should be able to connect the pins to my Pi and the USB portion to my laptop and access my Pi via Putty and / or VNC. Is that correct?

I'm running Jessie, which changes the way that DHCP is handled. I think the tutorial linked to above may be more appropriate for my machine, but I'm gonna look closely at what you sent.

I do see that the adafruit toot says Currently tested working on Raspbian only, with Jessie and up to Raspberry Pi 3

Thanks again,

NBUK

NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 7:59 pm

NoBodyUKnow wrote:
DougieLawson wrote:What ports are open on your RPi? ssh isn't enabled by default now.

I enabled SSH when I re-flashed the fresh Jessie image at the beginning of this thread, by adding file "ssh" to boot sector. I've been working headless, except for when I've been unable to access via SSH, for whatever reason.

sudo netstat -tlnp # have a look at what services are running:

Here ya go:
Running services.jpg
Doug,

It occurs to me, that we do not see hostapd running there. Shouldn't we see that?

User avatar
DougieLawson
Posts: 37074
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi as VPN Router and Wireless Access Point. Possible??

Tue Mar 28, 2017 9:58 pm

I don't think so, netstat -tlnp only looks for TCP/IP listeners.

Look for hostapd with ps auxf | grep hosta
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

NoBodyUKnow
Posts: 37
Joined: Wed Feb 15, 2017 3:44 am

Re: RPi as VPN Router and Wireless Access Point. Possible??

Wed Mar 29, 2017 2:42 am

Capture hosta running.JPG
Capture hosta running.JPG (27.54 KiB) Viewed 2641 times
Where does this leave us?

I think I have everything setup per the documentation James sent. Have you seen anything out of spec? I *have* run OpenVPN, but then I killed it.

User avatar
DougieLawson
Posts: 37074
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi as VPN Router and Wireless Access Point. Possible??

Wed Mar 29, 2017 12:25 pm

You're going to need to check all of the IP addresses that are used.

OpenVPN likes to use 10.8.0.xx/24 so that it doesn't conflict with anything other than another OpenVPN network.
James likes to use 192.168.xxx.xxx/24, try changing those addresses to 172.31.xxx.xxx/24
Your home router probably uses 192.168.xxx.xxx/24 unless you want to change that, treat that subnetwork as locked down, steer clear of the addresses used by your home router.

Check everything. Check your netmasks 255.255.255.0 (or in CIDR notation /24) means 192.168.1.xxx/24 is a different subnet from 192.168.0.xxx/24

You can use any network block from 10.0.0.0 (default netmask 255.0.0.0 or CIDR /8) to 10.255.255.255, any block from 172.16.0.0 (default netmask 255.255.0.0 or /16) to 172.31.255.255 and anything from 192.168.0.0 (default netmask 255.255.255.0 or /24) to 192.168.255.255. How you sub-divide those network blocks depends on your netmasks and your routing table.

You may see what's happening with an ip route command. You may be able to find your blackhole where your TCP/IP packets are falling off the net with traceroute (Linux version) or tracert (Windows version).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Advanced users”