[GUIDE] Configuring VPN for Dreamcast approaches

Online games, how to get online, and anything involving Dreamcast online can be discussed here.

Moderator: pcwzrd13

User avatar
Scrivani
Vagabond
Posts: 732
Contact:

[GUIDE] Configuring VPN for Dreamcast approaches

Post#1 » Wed Dec 21, 2022 9:19 pm

Benefits:
- Play up to 10 Dreamcast consoles on the same internet link when the game requires port opening, like a Lan Party/Events/Expo.
- Get ports open if you are on an ISP or a place that limits this access.

Service Provider of this this tutorial: PureVPN + port fowarding add-on subscription
PureVPN allows opening all ports or a list of 20. It must be chosen on the website after login. They allow 10 simultaneous connections.

Understand VPN Connection Protocols:
https://www.purevpn.com/what-is-vpn/protocols

Configuring Connection Methods:

Choose one:

A) OPENVPN for RaspberryPi
It means the RaspberryPi you use for DC will be connect to the VPN independently. It's not permanent, you choose when to turn it on, that means, only for games that require opening ports.

1- Installing Openvpn Client

Code: Select all

 sudo apt-get install openvpn


2- Download PureVPN OPENVPN Files and script:

Code: Select all

 
a) wget https://github.com/scrivanidc/purevpn-portfowarding-for-dreampi/raw/main/home/pi/openvpn/openvpn_purevpn_pf.zip
b) unzip openvpn_purevpn_pf.zip
c) sudo chmod +x  *

Captura de tela 2024-02-21 161710.png


3- Enter your PureVPN username and password inside "pass" file

Code: Select all

 sudo nano pass

- Inside the Nano text editor, paste your content:
Captura de tela 2024-02-21 161749.png

Control+O to save, Control+x to exit

4- Check the openvpn.sh file, to apply your IP Addressing pattern

Code: Select all

sudo nano openvpn.sh

#If needed, change both 192.168.0.98 to your IP pattern, example 192.168.1.98
Captura de tela 2024-02-21 162621.png



5- Every time you want to activate the VPN, just run the script below, do it after the RaspberryPi has started to the point of turning on the usb modem lights.

There is 5 openvpn files, so you choose from 1 to 5, they are alternatives:
1 - US Seattle UDP, 2 - US New York UDP, 3 - Canada Toronto TCP, 4 - Belgium Brussel UDP, 5 - Belgium Brussel TCP

Code: Select all

sudo bash openvpn.sh 1


If everything went well you will see results like these:
Captura de tela 2024-02-21 165319.png



5- Just go online and check a game that require port opening, like AFO.




B- Alternative method using Windows or modern OpenVPN Client compatible Routers
It means you will install VPN Service Provider windows application and share this connection with your RaspberryPi.

This method opens the possibility to easily use the other connection protocols like TCP, UDP, iKev2, WireGuard as these can be chosen in the Windows application. For example, Starlink don't support PPTP, so you'll need other protocol.

1- Decide how to share the windows connection with your RaspberryPi:
i) Laptop connected to wi-fi and sharing the connection via network cable to the RaspberryPi.
ii) Laptop connected to wi-fi and sharing the connection via wi-fi to RaspberryPi (HotSpot)
iii) Laptop connected using network cable and sharing the connection via network cable to the RaspberryPi. Two ethernet devices required.

2- Let's see option i)
- Install PureVPN Windows software, then connect to a Port Forwarding compatible server. I recommend determining UDP protocol
vpn1.PNG

- Now let's see how the VPN connection made looks like [TAP-Windows Adapter V9]:
vpn2.PNG

- Now we can share TAP-Windows Adapter V9 (there are other adapters according to the protocol you want), like these:
vpn3.png

Above you see AFO port opening, so yes, this method demand opening individual ports.

- Then you plug a CAT5e ethernet cable between PC/Laptop and RaspberryPi
- Go online and check it works. I've replicated this scenario as well and it's functional.

3- About the option ii) , the only difference will be that you will enable a completely new wifi network as if your computer were a wireless router (HotSpot), only old machines tend not to support this functionality. This Wi-Fi network created should be used on the RaspberryPi.

There is a ready-made guide for this, please check the attached PDF file.


4- The option iii) are the same instructions as the first i) , with the difference that you need to have two network cards, one to establish a connection to the computer and the other to share with the RaspberryPi. This one will be for hardcore users.


Mango GL-MT300N-V2 Portable Mini Travel Wireless Pocket VPN Router:
This is an example of Router support OpenVPN Client, that means you can configure your VPN with PureVPN OpenVPN files, a modern method compared to PPTP. The other concepts are the same as PPTP Router method.
Each VPN Service Provider will have their own OpenVPN configuration files to be downloaded.





UPDATE 2024/02/21
# PPTP Deprecated - does not have Port Fowarding anymore#
A) PPTP for RaspberryPi
It means the RaspberryPi you use for DC will be connect to the VPN independently. It's not permanent, you choose when to turn it on, that means, only for games that require opening ports.

1- Installing pptp-client

Code: Select all

 sudo apt-get install pptp-linux


2- Configuring PEER file, will contain the connection information:

Code: Select all

sudo nano /etc/ppp/peers/purevpn

In PureVPN example, this is the file content:

$VPNHOSTNAME > change to your server address/country, like us.pointtoserver.com or ukl1.pointtoserver.com
$USERNAME > change to your VPN Service Provider username
$PASSWORD > change to your VPN Service Provider password

Code: Select all

pty "pptp $VPNHOSTNAME --nolaunchpppd --debug"
name $USERNAME
password $PASSWORD
remotename PPTP
require-mppe-128
require-mschap-v2
refuse-eap
refuse-pap
refuse-chap
refuse-mschap
noauth
debug
persist
maxfail 0
defaultroute
replacedefaultroute
usepeerdns


3- Creating a script for VPN activation and ports fowarding from VPN to Dreamcast IP

Code: Select all

 sudo nano pptp.sh

- Inside the Nano text editor, paste this content:

Code: Select all

#!/bin/bash

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

sleep 2

sudo pon purevpn

sleep 10

sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

sleep 3

sudo iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to-destination 192.168.15.98

sleep 1

#change 192.168.15.98 to your IP pattern

File permission

Code: Select all

sudo chmod +x pptp.sh


4- Every time you want to activate the VPN, just run the script created above, do it after the RaspberryPi has started to the point of turning on the usb modem lights.

Code: Select all

sudo ./pptp.sh


If everything went well you will see results like these:

Code: Select all

ifconfig

Code: Select all

sudo curl ipinfo.io

PPTP_RASP_IFCONFIG.png

PPTP_RASP_IPINFO.png


5- Just go online and check a game that require port opening, like AFO.



B) PPTP for most regular Routers:
It means every device connected to this Router will be using the VPN and is pretty simple to configure. You also need to put Dremcast IP into DMZ Section.

1- It must receive an RJ45 internet cable on the WAN physical port. This router can be isolated on your network without impacting other devices.

2- Open your Router configuration page and look for WAN settings, same place where Dynamic IP is normally defined and choose the PPTP connection option:
PPTP_ROUTER_01.png


3- Just need to set the simple fields:
-Your VPN Service Provider username, password, server address, then Save and you should be connected.
PPTP_ROUTER_02.png


PPTP_ROUTER_03.png


4- Connect the RaspberryPi to this Router and go online normally.
Attachments
how-to-set-up-powerful-wifi-vpn-hotspot.pdf
(632.45 KiB) Downloaded 107 times
Last edited by Scrivani on Wed Feb 21, 2024 2:54 pm, edited 6 times in total.
Happy if may help:
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

User avatar
KmusDC
fire
Posts: 82

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#2 » Thu Dec 22, 2022 12:09 am

Thank you very much for this enormous contribution, I will test it, I will comment if it works for me.

ncman071
Sunday Shootout
Posts: 684

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#3 » Thu Dec 22, 2022 8:45 am

cool Scriv!!! Thank you for all this especially since i have starlink /cgnat

User avatar
itsthinkingstill
Vagabond
Posts: 787

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#4 » Fri Dec 23, 2022 3:07 pm

Been trying it out and works great! Thanks a bunch for the guide!

Been trying the last two days to have the script (via on the pi method) run on startup with a delay to give the modem light lots of time to connect before it executes, have had mix results so far, i have been able to get the vpn to connect but its not connecting proper since port forwarding is not being initiated, even though when running the script on its own connects fine, going to keep trying some stuff, got any recommendations?

User avatar
Scrivani
Vagabond
Posts: 732
Contact:

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#5 » Fri Dec 23, 2022 3:59 pm

itsthinkingstill wrote:Been trying it out and works great! Thanks a bunch for the guide!

Glad to know!

itsthinkingstill wrote:Been trying the last two days to have the script (via on the pi method) run on startup with a delay to give the modem light lots of time to connect before it executes, have had mix results so far, i have been able to get the vpn to connect but its not connecting proper since port forwarding is not being initiated, even though when running the script on its own connects fine, going to keep trying some stuff, got any recommendations?


Nice, let me understand:

Have you got Port Forwarding working through the manual execution? If yes, great.

About running on startup, you can call the shell script (pptp.sh) to run inside the dreampi script, after the modem startup, i can help you out with this, but i don't recommend, cause manual execution looks better, you should not want to use VPN on games that don't require Port forwarding...
Happy if may help:
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

User avatar
itsthinkingstill
Vagabond
Posts: 787

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#6 » Fri Dec 23, 2022 6:03 pm

Scrivani wrote:
itsthinkingstill wrote:Been trying it out and works great! Thanks a bunch for the guide!

Glad to know!

itsthinkingstill wrote:Been trying the last two days to have the script (via on the pi method) run on startup with a delay to give the modem light lots of time to connect before it executes, have had mix results so far, i have been able to get the vpn to connect but its not connecting proper since port forwarding is not being initiated, even though when running the script on its own connects fine, going to keep trying some stuff, got any recommendations?


Nice, let me understand:

Have you got Port Forwarding working through the manual execution? If yes, great.

About running on startup, you can call the shell script (pptp.sh) to run inside the dreampi script, after the modem startup, i can help you out with this, but i don't recommend, cause manual execution looks better, you should not want to use VPN on games that don't require Port forwarding...


Hey! Yep it works fine on manual execution.

For me, i dont mind running it manually, as i see this more of a bonus of not having to manually turn some ports on and off on the router when im feeling lazy, but im also setting this up for a friend, and the situation is that for them to connect to the pi is not always the easiest, so since most of the time the PI will be turned on, will be playing port forwarded games, i figure it be easier to see if it was possible to have it auto turn on whenever the pi is turned on, and kill it the times its not needed.

Il take a peak at the dreampi script, if you know where to try and add it that be help too! Again its not the end of the world if it dont work, but just wanted to see if it was a option before setting up the second pi.

Thanks again BTW, im sure this will help lots in the future!



Also pro tip to anyone, only certain purevpn servers support PF so make sure you check if the server you want to connect to has it, only a select few have it.

User avatar
Scrivani
Vagabond
Posts: 732
Contact:

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#7 » Fri Dec 23, 2022 6:22 pm

Ok,I will see where fits better to call the vpn script.

And just to share, this rule below is the piece of magic, after lot of study and troubleshooting, enables all ports tcp and udp from vpn connection to dreamcast ip. Is similar of what DMZ does in Router mode.

Code: Select all

sudo iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to-destination $dreamcast_IP



the other iptable rule, below, is the one who take the vpn connection to be considered as the main traffic output, this one was more best known, so to speak.

Code: Select all

sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
Happy if may help:
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

User avatar
Scrivani
Vagabond
Posts: 732
Contact:

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#8 » Fri Dec 23, 2022 10:29 pm

itsthinkingstill wrote: Il take a peak at the dreampi script, if you know where to try and add it that be help too! Again its not the end of the world if it dont work, but just wanted to see if it was a option before setting up the second pi.


You just need this:

from home login, type:

Code: Select all

 sudo nano dreampi/dreampi.py


add this line to dreampi.py code, after >> mode = "LISTENING" <<

Code: Select all

 subprocess.call("/home/pi/pptp.sh", shell=True)


dreampi_vpn_call.png


then save (control+o), exit (control+x), reboot pi.
Happy if may help:
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

User avatar
itsthinkingstill
Vagabond
Posts: 787

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#9 » Sat Dec 24, 2022 4:59 pm

Thanks! Gave it a shot and after alot of playing around, was not able to get the VPN to even connect on startup with it, so might just have to do the manual turn on each time

User avatar
Scrivani
Vagabond
Posts: 732
Contact:

Re: [GUIDE] Configuring VPN for Dreamcast approaches

Post#10 » Sat Dec 24, 2022 5:29 pm

I tested here and goes ok, maybe if you review the steps and check again for any character mistake.
Happy if may help:
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

  • Similar Topics
    Replies
    Views
    Last post

Return to “Online”

Who is online

Users browsing this forum: No registered users