Live Chat
  • One stop service: solve all your problems
  • Orders Tracking and shipped out notification
  • More campaigns, even more discounts!
  • Need help before making an order?
  • Chat with us in real-time.
  • For Aftersale issues, just submit a ticket. We will reply within 24 hours.
  • Multi-language service
  • 24/7 support available
Hi! Log Out Log In SIGN UP
Home > How To > How to use Raspberry Pi as a VPN router?
How to use Raspberry Pi as a VPN router?

How to use Raspberry Pi as a VPN router?

By  Midori Kusano 2019-05-31 1126 0

With the increase of Internet devices, I got a MikroTik 951G soft route to play. Then I accidentally discovered that openwrt not only has x86 version, but also supports Pi. I need to know that Pi's cpu and memory are absolutely killing HG255D router and so on.

Hardware preparation

Raspberry Pi one, note that B+ users are not perfect for the time being.

● USB wireless network card, here use AR9271 chip swift fw150ud, if you only use wired routing, you can not use

● USB cable network card, here use AX88772B chip cottage usb network card, if you only use wireless routing, you can not use

● You need a network cable to connect to a Gigabit switch or replace it with a replacement multi-port router.

● One SD card, one 128M or 256M is enough

● Micro USB cable and 5V, 2A power supply, two network cables, no explanation

● MikroTik 951G-2HnD, self-built PPPoE server for easy testing

Software preparation Openwrt

Implementation process

1. Prepare the SD card and write the disk image file openwrt-brcm2708-sdcard-vfat-ext4.img to the SD card.

Windows environment uses win32diskimager, which is simple and convenient.

The Linux system uses the dd command, dd if=~/foo.img of=/dev/sdX, X is replaced with the corresponding device name, using fdisk -l to view, foo is replaced with the corresponding image file name.

OS X environment, run diskutil list to check the location of the SD card, then use diskuitl unmountDisk /dev/diskX, uninstall the SD card, and finally execute, dd bs=1m if=~/foo.img of=/dev/diskX, replace foo with The corresponding image file name, X is replaced with the device number displayed by the diskutil list.

Second, the software settings

0.Openwrt will set Pi's own NIC IP address to 192.168.1.1, which is the same address as the main router in my network environment, so I need to modify it. You can use the computer and network cable to connect to the Pi separately. You can see the login interface by typing ip in the browsing. It will remind you to set the password of the root user. Click the link in the prompt to complete the password setting. Then edit the default IP in 192.168.1.11 in Network->Interfaces, and change the gateway to the upper-level routing IP, 192.168.1.1. DNS is also required.

Another method is to connect the keyboard display. After starting the Pi, edit the /etc/config/network file. The novice friend still recommends the first method.

1. Connect the Pi self-contained network card to the upper-level router, and enter 192.168.1.11 in the browser address bar to open the management page.

2. Install the usb NIC driver, select System->Software in the menu, first click “Update Lists” to update the software list.

After completing the update, enter kmod-usb-net and kmod-usb-net-asix in the "Download and install package" text box. Click "OK" to install the driver for the USB cable NIC.

3. Install the usb wireless network card driver, the same method to install, kmod-ath9k-htc, and finally restart the PI, you can find the wireless network card and wired network card.

4. Configure the wireless AP, install the hostapd and wireless-tools software as described above, and then click “Edit” to configure the “AP” information in Network->Wifi.

Finally click on the green icon "Enable" button to start the wireless AP, open the phone to see a wifi hotspot called OpenWrt.

When connecting to the newly created wifi hotspot, if there is a problem that the IP cannot be obtained after the connection occurs, there may be no bridge between the wireless device and the gateway. The latest version 14.7 OpenWrt is automatically set. Before using OpenWrt 12.9, it is manually configured. .

5. Set PPPoE dialing, click "Add new interface..." in Network->Interfaces to add an interface, then select eth1, select PPPoE in "Protocol of the new interface".

Finally, after clicking “Submit”, the following interface will appear. Enter the user name and password to implement PPPoE dialing.

After completing the username and password, click on "Physical Setting" and select the "eth1" interface.

Finally, click “Save & Apply” to save and apply the settings, then dial the Internet automatically, or click the “Connect” button on the WAN port in the Network->Interfaces interface to dial up.

Note that the premise of this step is to connect the Pi's USB cable to the optical cat and the ADSL cat through the network cable. The Pi comes with a network card to connect to the lower-level router or switch.

PS, after each page of the management interface, you need to click "Save & Apply" to save the settings, if this button appears.

PS, because it is a test environment, pppoe is connected to the Mikrotik 951G to achieve dial-up Internet access, so the ip address shows 10.1.1.3.

PS, the purpose of the first three steps of software setup is to use the existing router to install the NIC driver. You can also set the PI NIC as the PPPoE client to dial up and install the corresponding driver. The method is the same as the software setting above. Eth1 can be changed to eh0.

 You may also want to read:
 Xiaomi Roborock S6 review: a powerful robot vacuum cleaner
  New Dell XPS 15 9580: what is needed for the 2019 edition
 Huawei has registered "Hong Meng": name of Huawei OS

 

Gearbest Shopping on Gearbest

 

Gearbest online shopping on GearBest

Extensive Product Selection

● Over 300,000 products

● 20 different categories

● 15 local warehosues

● Multiple top brands

Convenient Payment

● Global payment options: Visa, MasterCard, American Express

● PayPal, Western Union and bank transfer are accepted

● Boleto Bancario via Ebanx (for Brazil)

Prompt Shipping

● Unregistered air mail

● Registered air mail

● Priority line

● Expedited shipping

Dedicated After-sales Service

● 45 day money back guarantee

● 365 day free repair warranty

● 7 day Dead on Arrival guarantee (DOA)

Prev article:How to record a phone call on your iPhone

Next article:How to back up, restore, or migrate WhatsApp message and date?

You might also like: