How to use Raspberry Pi as a VPN router?
By Midori Kusano 2019-05-31 1984 0
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
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|
● Over 300,000 products
● 20 different categories
● 15 local warehosues
● Multiple top brands
● Global payment options: Visa, MasterCard, American Express
● PayPal, Western Union and bank transfer are accepted
● Boleto Bancario via Ebanx (for Brazil)
● Unregistered air mail
● Registered air mail
● Priority line
● Expedited shipping
● 45 day money back guarantee
● 365 day free repair warranty
● 7 day Dead on Arrival guarantee (DOA)
2019-08-27By Joe Horner
2018-01-17By Adeline Belluz
2017-04-27By Zim Watson
2019-06-13By Ingrid You
2017-02-18By Zim Watson
2017-12-11By Adeline Belluz
Prev article:How to record a phone call on your iPhone