Port forwarding - please help ! (2024)

One little problem, we didn't define exact setup for the example, so there are multiple ways how to handle it. What I posted could be for one ISP connection with two public addresses. That's how I understood your "WANIP 1234/5678", as two public addresses assigned to router, and that rule #2 should work with one and rule #3 with the other. And in-interface=<WAN> (or in-interface-list=<WANs> if there would be more than one internet connection) in rules #1 and #4 is the basic port forwarding config, where you don't care about destination (and which is in many cases wrong; sorry, I took a shortcut)...

See, that's the thing, there are too many ways how to handle things. Even with clearly defined setup, there's usually more than one way how to reach target goal. And they are often not 100% right or wrong, you can use shortcuts that are perfectly fine for one situation and better solution would be just waste of resources, but they would not work well for seemingly similar setups, only because there's one tiny little difference that changes everything. And now when we don't have exact setup to work with, I can imagine all missing details any way I want and number of possible solutions is endless. And it can also be confusing, when you expect something else.

So, lets try it like this:

Port forwarding uses NAT (dstnat), and it's nothing special, it's just a very simple action that changes destination address and/or ports. It's just one processing step. Packets come to router, dstnat changes destination, router finds out where to send it based on destination address (in this case the changed one), then it goes through forward filter and if it's not stopped there, router will send it out, but there's still srcnat which could change source. And that's it. When I have conditional dstnat rule, then when the condition is not met, dstnat does not happen, packets keeps original destination address (public IP of router), which will send them to input chain and there they will be dropped by default firewall.

About dstnat rules and possible ways to match packets, probably the most correct is to use dst-address. When you're connecting to e.g. http://yourserverbehindnat.domain.tld, the hostname resolves to one specific address, so you should be looking for that. But the address is often not static, so you can't do that, without updating the rule all the time. That's why people often use in-interface, with reasoning (if they have any) that it must be for the right address, when it came to router from internet. Which is not exactly correct, it might be also fake packet from evil hacker or something (and it's whole different story). It's also bad habit, because even though it's mostly fine when you have only one address, people get used to it and then they wonder why it makes problems when they get more addresses.

Another possible problem is that sometimes you want to be able to access same hostname also from LAN (the same one where's the target server). For that, you need another thing called hairpin NAT, but it can't work when your dstnat rules don't work for connections from LAN. And with in-interface=WAN they won't.

Yet another approach it to use dst-address-type=local, and it will match when destination address is assigned to router. No matter how often your WAN address changes, it will still work. But it will match any of them. So when you do this for e.g port 80, it will work great for connections from outside and inside (if you add hairpin NAT rule), but you'll block yourself from accessing WebFig on <router's LAN IP>:80, because it also matches dst-address-type=local and dstnat will redirect the request to webserver machine. So you'll have to add extra dst-address=!<router's LAN IP> and it will finally work. At least for most simple cases, I can still imagine some more complex ones, where it could be wrong.

About jumps example, imagine you have several WANs, you want different sets of dstnat rules for each, and you have a lot of them:

Code: Select all

/ip firewall natadd action=dst-nat chain=dstnat in-interface=WAN1 <other conditions><other 998 rules for WAN1>add action=dst-nat chain=dstnat in-interface=WAN1 <other conditions>add action=dst-nat chain=dstnat in-interface=WAN2 <other conditions><other 998 rules for WAN2>add action=dst-nat chain=dstnat in-interface=WAN2 <other conditions>add action=dst-nat chain=dstnat in-interface=WAN3 <other conditions><other 998 rules for WAN3>add action=dst-nat chain=dstnat in-interface=WAN3 <other conditions>

If you do it like this and a new incoming connection comes to WAN4, router will have to check all 3000 rules, before realizing that none is applicable. But if you do:

Code: Select all

/ip firewall natadd action=jump chain=dstnat in-interface=WAN1 jump-target=<dedicated chain for WAN1>add action=jump chain=dstnat in-interface=WAN2 jump-target=<dedicated chain for WAN2>add action=jump chain=dstnat in-interface=WAN3 jump-target=<dedicated chain for WAN3>add action=dst-nat chain=<dedicated chain for WAN1> <other conditions>...

Then for the same connection, only three rules will be checked.

Somehow then, the Router Has the ability to check the traffic against the NAT rules to see if it matches a DST NAT RULE and if so says JUMP or GO TO PORT FORWARD process.

There's really no "port forward process", it's just a simple change of destination address, as described above. And similar to this, all conditions you can use for any rule are just simple checks, if current packet has given property or not. Don't look for anything complicated, it's not there.
Ok, there is some "magic" involved, a connection tracking, which understands the traffic flow, recognizes packets that belong to same connection, etc. It's the thing that makes stuff like connection-nat-state work. But don't worry about that, just know it's there and it "just works".

I am not seeing any advantage or savings but instead see creating more rules and processes than is required??????

Again, it doesn't do much, when you have only few rules and it might not be worth it to do something like this. Some things only start to make sense when you're dealing with large amount of stuff.

Port forwarding - please help ! (2024)

FAQs

Port forwarding - please help !? ›

Check port forwarding settings on your router to ensure they are correct. Test the internal connection by accessing the device/service within your network. Test the external connection using an external device or online port-checking tool. Verify that firewall settings allow incoming connections on the forwarded ports.

Why is port forwarding not working? ›

Check port forwarding settings on your router to ensure they are correct. Test the internal connection by accessing the device/service within your network. Test the external connection using an external device or online port-checking tool. Verify that firewall settings allow incoming connections on the forwarded ports.

How to manually set up port forwarding? ›

How to open ports on a router
  1. Access your router's web interface. Navigate to your router's configuration page by typing the router's IP address into your browser.
  2. Log in to your router. ...
  3. Find the port forwarding section. ...
  4. Add a new port forwarding rule. ...
  5. Save the changes.
Jun 19, 2023

What to put in port forwarding? ›

​​W​hen you set up a server to host your website at home, you have to add port forwarding rules to your router. You do this by finding the IP address of the computer running your website and setting a rule to forward all traffic on port 80 to that IP address. You can also specify the port you forward the data to.

What is blocking my port forwarding? ›

A firewall can block incoming traffic to your network, including traffic that you're trying to forward. Make sure that the firewall is not blocking the port you're trying to forward. You can check your firewall settings to see if the port is open or closed.

How do I check if my port forwarding is working? ›

We recommend using a reliable port forward tool like www.portchecktool.com. The port forward checker tool is a valuable resource for network troubleshooting. It helps you check whether your ISP (Internet Service Provider) is blocking specific ports, such as the commonly restricted HTTP port 80 and SMTP port 25.

Do I need to restart my router for port forwarding? ›

If prompted, you'll also need to allow your router to restart in order for the changes to take effect. You may also have to check an "Enabled" or "On" box next to the forwarded port row.

Do I need to enable port forwarding? ›

Your NAT firewall, which resides on your router, sends incoming connections to the devices that requested them, by extension also blocking unwanted incoming data. It does this automatically, but if you want your home devices to connect to a remote device, you need to set up port forwarding.

How to check if a port is open? ›

Press the Windows key + R, then type "cmd.exe" and click OK. Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status. If the port is open, only a cursor will show.

Do I need a static IP address for port forwarding? ›

What generally happens is that the IP address your computer gives you will change, so one day you have an IP of 192.168. 1.100, and the next it might be 192.68. 1.101. Any port forwarding configuration you make on your router needs to be fixed to a certain IP address, so it's important that it doesn't change.

What is port forwarding for dummies? ›

Port forwarding defined

Port forwarding achieves by creating an association called a map between a router's public, wide area network (WAN) internet protocol (IP) address and a private, local area network (LAN) IP address for a device on that private network.

What port to open for port forwarding? ›

Often, the port numbers of well-known Internet services, such as port number 80 for web services (HTTP), are used in port forwarding, so that common Internet services may be implemented on hosts within private networks.

What is my port number? ›

How to find your port number on Windows. Type “Cmd” in the search box. Open “Command Prompt.” Enter the netstat -a command to see your port numbers.

Can an internet provider block port forwarding? ›

Some ISPs block port forwarding on routers to prevent users from running servers on their home networks. This is often done to prevent network congestion and to maintain network security.

Should port forwarding be enabled or disabled? ›

Without knowing any specifics about your network, general best practice is don't open/forward ports on the firewall unless you have a good and well-understood reason to do so. If this is in a home I suggest disabling the port forward and seeing if anything breaks. You could always re-enable it.

Why is forwarding not working? ›

There are a few reasons why this might be the case. The message was sent to the wrong address, or the address is misspelled. You have not activated forwarding for your email forwarding address. You set up your email forwarding address within the last 24 hours, and it has not yet been transferred to the mail server.

What prevents port forwarding? ›

It could be that your internet service provider (ISP) is restricting traffic on that port. Or it might be that some firewall rules or other security measures on your networks are blocking or filtering certain types of traffic.

How long does it take for port forwarding to take effect? ›

It will depend on the particular router; however, in my experience with residential routers port forwarding takes effect immediately it is added to the configuration.

Why is port not working? ›

USB-related issues can be caused due to incompatible device, outdated, incorrect, or corrupt drivers, damaged USB ports or cables, faulty USB port, and so on.

Top Articles
BCVA response to Brian May: The Badgers, the Farmers and Me
Top 10 Urgent Care Centers for TB Tests in Rancho Cucamonga - Lani City Medical
These Walls Have Eyes Walkthrough - The Casting of Frank Stone Guide - IGN
Canvas Rjuhsd
Osrs Tokkul Calculator
Www Craigslist Com Juneau
Cost Of Fax At Ups Store
How to cancel subscriptions on your iPhone through the Settings app
Louisville Kentucky Craigslist Cars And Trucks By Owner
Craigslist Richmond Ba
Europese richtlijn liften basis voor Nederlandse wet - Liftinstituut - Alles voor veiligheid
Morbus Castleman - Ursachen, Symptome & Behandlung
Mit 5G Internet zu Hause genießen
Email Hosting » Affordable Mail Solution with Personal Domain | IONOS
Milk And Mocha Bear Gifs
Rooms for rent in Pompano Beach, Broward County, FL
5417873087
Annika Noelle Feet
Roadwarden Thais
Best Stb 556 Mw2
73 87 Chevy Truck Air Conditioning Wiring Diagram
Best Builder Hall 5 Base
Mileage To Walmart
123Movies Evil Dead
The Eye Doctors North Topeka
Fungal Symbiote Terraria
Kvoa Tv Schedule
Oh The Pawsibilities Salon & Stay Plano
Cric7.Net Ipl 2023
The Quiet Girl Showtimes Near Landmark Plaza Frontenac
Usc Human Biology
Maurice hat ein echtes Aggressionsproblem
Syracuse Deadline
Locals Canna House Deals
100X35 Puerto Rico Meaning
Pain Out Maxx Kratom
Music Lessons For Kids Penshurst
Www Muslima Com
Liv Morgan Wedgie
Directions To 401 East Chestnut Street Louisville Kentucky
Sacramento Library Overdrive
Pirates Bay Knaben
Shaws Myaci
Jeep Forum Cj
The Hollis Co Layoffs
Hourly Pay At Dick's Sporting Goods
Embu village mines precious coltan for years 'without knowing its value’
Intoxalock Calibration Locations Near Me
Steel Punchings For Sale
8X10 Meters To Square Meters
H'aanit's Third Chapter | Gamer Guides: Your ultimate sou...
LP Vinyl Samling pop rock thrash metal trance
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 6038

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.