0

I’ve looked at this board and done quite a few Google searches and haven’t found what I’m looking for. I have read a few replies to posts that say the writer should include more information and be specific about questions, I hope this isn’t too much info. I just purchased a PI 4 8GB and have a specific project in mind. I want to use the PI while I travel in China for an extended period of time. I will need VPN, connection to a small unmanaged switch for my VIOP adapter (Google Voice), and a WiFi access point.

What I want to do is take the PI 4 and use it to connect via ethernet to a local router (I will not be able to access the router to change any settings). I want the PI 4 to function as a VPN, connected to a commercial provider either Nord or Express since these have worked in China before on my phone. I also want to use the commercial VPN to avoid Geo-blocking for Google Voice and streaming services. I will connect the VOIP adapter to the 5 port switch. I plan to bridge two ethernet connections on the PI to connect the switch and VOIP adapter to the internet through the VPN. I would also like the PI to be a WiFi access point for my phone, iPad, and smart TV while I’m there.

Currently I’m using Ubuntu 20.04 and have gotten pieces to work but I seem to take 2 steps forward an 1-3 back.

Here’s what I’ve tried so far: • I used the “built in” Hotspot feature in Ubuntu and that worked perfectly.

• I tried using the Nord application to connect to their servers but when I did I lost traffic to the internet on the Hotspot.

• Next I used the “built in” VPN feature in Ubuntu for eth 0. I downloaded the Nord UDP config files and loaded they through the Network Manager. That also worked like a charm providing VPN to the ethernet connection and the Hotspot.

The above worked great but I need to run this thing headless and plan to ssh from my laptop to monitor and control the PI. • I’ve tried using Ubuntu’s Network Manager Command Line Interface (nmcli) with limited success.

• I have tried nmcli connection up Hotspot and that seems to work. I can confirm this by looking an the output from ifconfig which shows a 10.42.0.1 address in place of the 192.168.0.X.

• I have NOT found a way to enable the VPN on eth0 from the command line.

The next issue I’m running into is trying to bridge two ethernet connections so I can connect to my VOIP adapter via the switch. • I have bridged internet connections (using brctl commands) and connected the VOIP adapter on an old laptop running Mint so I know it is possible.

• When I plug in a USB adapter to the PI 4 Ubuntu freezes and will not respond to keyboard or mouse. Is it possible to bridge ethernet connections on a PI?

I thought if I could get everything to work from the GUIs in Ubuntu I could remote in from my windows laptop but that’s proved to be a challenge as well. I tried VNC but it would never connect to the PI. I tried installing xrdp on the PI and using Windoze Remote Desktop connection and was unable to connect to the PI. If anyone can suggest any other ways I can connect to the HEADLESS PI that would be helpful too.

Questions:

  1. I need some advice on selecting an OS. I have downloaded Raspbian (32 bit), Ubuntu 20.10 (64 bit) and Ubuntu server (64 bit). Which would be the best choice for this application that will run headless?

  2. Is it possible to bridge two ethernet connections on a PI and pass data through to a switch/connected device?

  3. How can I enable the VPN for an ethernet connection from an ssh terminal in windows with the Nord config file(s)?

  4. What packages or software I will need to install to the Ubuntu Server to accomplish this?

  5. Can someone point me to some good tutorials that may help (it’s difficult to sort out all the information on the web).

I Thank you in advance.

3
  • I fail to see the need for all the complications. You have the access to the wifi hotspot solved and to the VPN on the eth0. Everything connects to the wifi then goes through the normal routing in the machine to get to the eth0 and the internet, where does this bridging come into the picture? The second, eth1, if used can provide the same access using the already existing routes for a hub/switch. With the Pi giving out the IPs from DHCP server on it. For the packages all that is needed is basic install of the server with SSH, DHCP, VPN software it gives you everything you needed to do it.
    – user130167
    Commented Feb 21, 2021 at 16:53
  • I would add the USB on these things is so damn flaky, who knows if it is possible to get done what you need, with mine, my keyboard connected to it kills a boot.
    – user130167
    Commented Feb 21, 2021 at 16:56
  • Don't ask 5 questions at once. Pick one problem and concentrate on just solving that one. Commented Feb 21, 2021 at 17:09

1 Answer 1

1

You asked five questions. This is usually not the optimal format for this site. But I see your problem and will give some information how I would solve it. I prefer to Use systemd-networkd for general networking because it can do many things out of the box.

  1. I need some advice on selecting an OS. I have downloaded Raspbian (32 bit), Ubuntu 20.10 (64 bit) and Ubuntu server (64 bit). Which would be the best choice for this application that will run headless?

Most of us here use the Raspberry Pi OS. It is official supported by the Raspberry Pi foundation and you will also find most know how about it on this site. Because you want to have a headless installation with ssh connection you should direct start with it using the Raspberry Pi OS Lite version. It is a full featured image without the overhead of the unneeded graphical user interface and additional Desktop and Office software. If you need additional things you can always install them from the repository.

  1. Is it possible to bridge two ethernet connections on a PI and pass data through to a switch/connected device?

Yes, it is possible to bridge two (or more) interfaces on the RasPi. It is not a question of the RasPi but of the used network stack. Of course you need an additional USB/WiFi dongle for the second wired interface. And of course it will also transfer data with the interface connected to a switch/device. With a bridge it doesn't matter what devices are connected to it as long as they support the ethernet protocol (OSI layer 2).

  1. How can I enable the VPN for an ethernet connection from an ssh terminal in windows with the Nord config file(s)?

This is the most difficult part because I don't know the Nord config files. Mostly they have special requirements to connect to their equipment and often offer their own VPN client. Because VPN is mostly a routing problem I would do this setup as last step when all other interfaces are up and working. Then you can add the virtual VPN (TUN?) interface and have a look at the routing. For some generic information you can look at How to bridge an access point with a remote network by Wireguard and Simple openVPN with static keys.

  1. What packages or software I will need to install to the Ubuntu Server to accomplish this?

With the Ubuntu Server I cannot give an advice. I haven't used it before. With my suggestion, as far as I can see, you only need systemd-networkd that can manage the network interfaces, the bridge, the access point and Wireguard as supported VPN solution. For the access point you can look at Setting up a Raspberry Pi as an access point - the easy way. You will also find there how to add the WiFi to the bridge.

  1. Can someone point me to some good tutorials that may help (it’s difficult to sort out all the information on the web).

I don't think that you will find a tutorial that just covers your requirements. You have to put the components together by yourself. I think the links I have given may help you. They all base on the same network environment and configuration method.

Not the answer you're looking for? Browse other questions tagged or ask your own question.