Community discussions

MikroTik App
 
yomach
just joined
Topic Author
Posts: 2
Joined: Mon Feb 27, 2023 10:54 am

Forward from ether1 port 80 to ether2

Mon Feb 27, 2023 11:01 am

Hi,

I have the MikroTik running as a DHCP server for ether2-ether10. And ether1 is connected to the outside network.

Is it possible to make a "port forwarding rule" that any request coming in to the router at port 80, will be forwarded to ether2?

I can think of one (slightly ugly) workaround: create another DHCP pool only for ether2 that includes a single address and then port forward to that address.

But is there a simpler way?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19101
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Forward from ether1 port 80 to ether2

Mon Feb 27, 2023 5:46 pm

YES, but no one I know forwards a port to an entire subnet????
 
Moba
Member Candidate
Member Candidate
Posts: 206
Joined: Sun Sep 27, 2020 6:15 pm

Re: Forward from ether1 port 80 to ether2

Mon Feb 27, 2023 7:46 pm

The people you know sound boring. I leave rooms in my house open all the time so people I don't know can come in and do as they please...
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: Forward from ether1 port 80 to ether2

Mon Feb 27, 2023 8:59 pm

What are you actually trying to accomplish? Normally you would be forwarding to your web server - which will normally have either a static IP or a DHCP reservation (called static in Mikrotik). Then a simple NAT rule to forward port 80 traffic to that IP.
Are you doing something different?
 
yomach
just joined
Topic Author
Posts: 2
Joined: Mon Feb 27, 2023 10:54 am

Re: Forward from ether1 port 80 to ether2

Tue Feb 28, 2023 10:28 am

We ship the Mikrotik with our products, preconfigured to allow them to work.
We have a few devices that act as a cluster, and are configured with DHCP. They are identical but one of them takes the rule of a web server.
Moreover, since they are identical, the device taking the rule of the web-server can be replaced by another (either because it is faulty, or because the system configuration is changed). We want the Router configuration to be relatively static, which means that we do not know which of the devices acts as the web server, or what is his IP address.
We can know (or enforce) that the server will be connected to Ether2.

Up until now, we used static IPs, and made sure that the server had a specific IP outside of the DHCP range, but we want to change that.

This means that redirecting traffic coming into port 80 to Ether2 will solve our problem (instead of a specific IP, as in a normal port forwarding rule that we are currently doing).

Another option we just found: Creating a separate vlan with some IP address, bridge it to Ether2, and forwarding traffic to that IP. Sounds less ugly compared to 2 DHCP pools.
 
User avatar
Ca6ko
Member
Member
Posts: 499
Joined: Wed May 04, 2022 10:59 pm
Location: Kharkiv, Ukraine

Re: Forward from ether1 port 80 to ether2

Tue Feb 28, 2023 2:03 pm

You cannot send a letter to, for example, Paris to all flats No. 80.
The pact must have a specific address/port. The task you can do is to make sure that the server is at the right address.
You cannot add a DHCP server to a port if the port belongs to a bridge. You can exclude port 2 from the bridge and set up a separate network on it with its own addressing. And set up the DHCP so that your server always gets the same address.

Who is online

Users browsing this forum: 0xAA55 and 34 guests