How to Port Forward in OpenWrt

  • Post author:WunderTech
  • Post published:March 16, 2023
  • Post last modified:May 10, 2024
  • Post category:OpenWrt
  • Reading time:6 mins read

This tutorial looks at how to port forward in OpenWrt.

If you’re new to OpenWrt, port forwarding might be slightly confusing. Especially if you’re coming from a “basic” router, where port forwarding is handled by entering the port, protocol, and local server.

While OpenWrt isn’t necessarily more difficult than a basic router, there are additional settings that can be configured that will change the port forwarding.

How to Port Forward in OpenWrt

We will look at how to port forward in OpenWrt below.

1. Log in to OpenWrt and select Network, then Firewall.

openwrt firewall section.

2. Select Port Forwards, then select Add at the bottom.

openwrt port forwards.

3. Enter the information for port forwarding based on the information below.

  • Name: The name that you’d like to use to recognize this port forwarding.
  • Protocol: TCP or UDP
  • Source Zone: WAN
  • External Port: The port you’d like forwarded (I am using HTTP in this example).
  • Destination Zone: LAN
  • Internal IP Address: The internal IP address of the device you’d like to expose.
  • Internal Port: Same as the external port set above.

After all of the settings have been configured, select Save to save this port forwarding rule.

openwrt port forwarding rule. How to Port Forward in OpenWrt

4. After the rule has been saved, select Save & Apply to save and apply these settings. You can also see at this point that it’s set to forward to the IP address set and the port specified.

configured port forwards in openwrt.

5. You can now test the port forwarding rule to confirm it’s working as expected!

Advanced Settings to Limit Traffic

While the settings above will provide a basic port forwarding rule (and will most likely be perfect for most people), there are advanced settings that you can view by selecting Advanced Settings.

advanced settings in port forwarding.

There are a bunch of advanced settings here, but some of the more important ones (in my opinion) are listed below:

Source IP Address: Limit the traffic to a specific IP address, IP Range, or IP Subnet.

Source Port: If you know for a fact that traffic should only be coming from a specific source port, you can limit it here.

advanced settings in port forwarding section.

There are a bunch of other settings as well, but the two options above are what I think most users will use. The other settings are available and if you can benefit in some way from them, you can certainly configure them!

Conclusion & Final Thoughts

This tutorial looked at how to port forward in OpenWrt. Configuring a port forwarding rule in OpenWrt is pretty straightforward, though there are more settings than most users are used to if coming from generic router firmware. In the advanced settings section, there are a bunch of different settings that can be modified to customize the port forwarding rule.

Thanks for checking out the tutorial on how to port forward in OpenWrt. If you have any questions, please leave them in the comments!

WunderTech

WunderTech is a website that provides tutorials and guides on various NAS, server, networking, and infrastructure-related topics. WunderTech is maintained by Frank Joseph, an IT professional with 14+ years of experience in corporate IT and application management. He focuses on sharing his experience with others on his WunderTech website and YouTube page. Frank holds a Bachelor of Science in Computer Information Systems and a master of Business Administration (MBA).