[Raspberry Pi] Build an OpenWrt soft router and use it as a bypass router configuration and application method

Using the ARM architecture as a soft router, the first consideration is the price. When the Raspberry Pi is used as an ARM soft router, it is very small but powerful and silent, which is a perfect match. Here I choose the Raspberry Pi 3B+ with a Gigabit Ethernet port. Its main advantages are:

  1. Performance exceeds most ARM soft routers
  2. Small and quiet, power consumption as low as 3W, standby temperature increase of 16 degrees is the best in the same size!
  3. The purchase price of the mining disaster is only 200 yuan, the best cost-effective
  4. The ARM soft router with the best network card compatibility

insert image description here

Of course, it should be noted that the Raspberry Pi 3B+ Gigabit network is extended through 480M USB2.0, so it is better to use 4B if possible.

insert image description here

In order to solve the problem that hard routing does not support custom domain name ddns resolution; ssh remote wake-up and other functions, here the soft routing is used as a gateway server.


1. Configure Raspberry Pi

1. Get the Raspberry Pi OpenWrt image

Choose the appropriate mirror . It is recommended to choose the Lean version of the firmware version, which is stable in operation and has many plug-ins; the recommended squashfs-sysupgradeversion of the file format.

Raspberry Pi 3B+ recommends using the openwrt-bcm27xx-bcm2710-rpi-3-squashfs-factory image

Image download: openwrt-bcm27xx-bcm2710-rpi-3-squashfs-sysupgrade.img

2. Write the image

Insert the SD card into the card reader and connect it to the computer, run SDFormatter.exe to format the SD card, open Win32DiskImager.exe to burn the image, click "Write", and then insert the SD card into the Raspberry Pi.

insert image description here

Format the SD card

Burn image

3. Fix the ip and close the dhcp service after booting

Strictly follow the: Bypass Router Setup Guide and that's it!

uci set network.lan.ipaddr=192.168.1.8
uci commit network
/etc/init.d/network restart

2. Networking scheme

For detailed networking solutions, please refer to my blog post: Home networking: Vlan single-line multiplexing, fault detection and five "soft routing" plus mesh networking solutions
insert image description here
Raspberry Pi as a bypass router, connected to the main router lan port or switch A Any port in vlan9 can be used.

Inside the electric well box


3. Bypass router configuration method

Initial firmware account root, password password

insert image description here
Modify the lan port information, check whether the ip is fixed, and set the gateway as the main routing address.

insert image description here

Protocol: Static address
IPV4 Address: 192.168.1.8 (This item remains unchanged)
Subnet mask: 255.255.255.0
Gateway: Fill in as the upper-level routing IP, which is usually the access address of the upper-level routing control panel. Taking the above as an example, change it to: 192.168.1.1
Broadcast: Change the last segment of the upper-level routing IP to 255. Take the above as an example and change it to 192.168.1.255
DNS address: Same as the upper-level routing IP. Take the above as an example: change to 192.168.1.1
Tick: Ignore this Interface/Do not provide DHCP service on this interface (at the bottom of the page)

insert image description here

Check again whether the DHCP service is turned off.

insert image description here

The following steps can be omitted

Close the bridge interface and make sure the only network port is the lan port.

insert image description here
insert image description here

At this time, return to the main route and you can see that the Raspberry Pi has been connected to the LAN.

insert image description here

Be sure to fix the ip address of the Raspberry Pi on the main router!
Be sure to fix the ip address of the Raspberry Pi on the main router!
Be sure to fix the ip address of the Raspberry Pi on the main router!

After that, modify the default gateway of the Internet access device to the address of the Raspberry Pi.

insert image description here
It should be noted that in order not to damage the computer’s wolan wake-up function and remote VNC access function, it is best to disconnect the wireless network and use a wired connection (because the two access gateways conflict at the same time, and the wired network is a necessary condition for wolan wake-up) , and set the ip address to the original fixed ip address in the router. Remember not to forget to fill in the DNS server 114.114.114.114or directly fill in the bypass route address .


4. Common applications

  1. Remote wakeup
    OpenWrt can install wol or etherwake to realize the network wake-up function (provided that your host needs to support network wake-up)
opkg update
opkg install wol
opkg install etherwake
#唤醒方法
etherwake -b F0:76:1C:E1:EA:D8
  1. PassWall load balancing
  2. Set up ddns on the bypass router to solve the problem of few ddns service providers on the main router.
    Click here to view the graphic tutorial , and also watch the video
    insert image description here
    insert image description here

insert image description here

http://ip.3322.net/


Ali CEN speed test:

insert image description here


So far, this article has come to an end. I hope this article can play a role in attracting jade, and welcome everyone's criticism and exchange.


If you have any questions or good suggestions, look forward to your message, comments and attention!

Guess you like

Origin blog.csdn.net/deng_xj/article/details/113856220