Community discussions

MikroTik App
 
User avatar
owk444
just joined
Topic Author
Posts: 2
Joined: Wed Apr 18, 2018 10:17 am
Location: Moscow
Contact:

Port forwarding on non-interface IP

Wed Apr 18, 2018 10:56 am

Hi All!

I have problem.

My ISP gave to me a block 185.x.x.80/29 of IP addresses. I attempted to translate internal server IP to one of this external IP, but no success.

I made this:

chain=dstnat action=dst-nat to-addresses=10.3.2.12 to-ports=80 protocol=tcp dst-address=185.x.x.86 dst-port=80 log=yes log-prefix=""
The WAN IP of the Mikrotik is 185.x.x.82 and NAT on interface works fine.
Also I made a filter rule:

chain=input action=accept dst-address=185.x.x.86 log=yes log-prefix=""

but telnet to 185.x.x.86 80 says "No route to host". Ping also doesn't work. As I see, Mikrotik does not announce own WAN mac as 185.x.x.86 ( ARP ) to subnet 185.x.x.80/29 and ISP can't understand where is 185.x.x.86, and drops incoming packet.

I did "Torch", and see no packets from the Internet to 185.x.x.86. Log is also empty.

Where I can wrong?

Thank you
Last edited by owk444 on Sat Apr 21, 2018 10:23 pm, edited 1 time in total.
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Port forwarding on non-interface IP

Fri Apr 20, 2018 8:04 pm

Edit your post, you are exposing your public IP's

Add 185.x.x.86. to your Mikrotik WAN interface, you can have multiple IP's on interface
 
solar77
Long time Member
Long time Member
Posts: 586
Joined: Thu Feb 04, 2016 11:42 am
Location: Scotland

Re: Port forwarding on non-interface IP

Sat Apr 21, 2018 11:50 am

AS CZFan suggested, you can have mutple IP assigned to the same interface so you could give 185.x.x.80/29 to your WAN interface.

for port forwarding to work, you need dst nat, which you already have.
you also need hairpin nat, so traffic from the web server can travel back to the route it came from
this is a good demo:
https://www.youtube.com/watch?v=_kw_bQyX-3U
but you could have
add chain=srcnat action=src-nat src-address=LAN IP of web server,  to-address=WAN IP you wish to associate to the web server
PS: you don't need the accept rule on input chain for port 80, if there is already a dst nat rule.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19379
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Port forwarding on non-interface IP

Sat Apr 21, 2018 6:17 pm

I am confused by past experience.
Typically, one takes the first or ONE of the block of IPs and assigns it to the router.
Practically speaking this if for the purposes of establishing a clear WAN to LAN relationship when one has one or more LANs they would like to have private.
The other block of IPs could be used for individual servers etc where external access is very likely.

Thus for all the services on the MAIN WAN (such as a private user on the LAN wants to run an FTP server for example), one does need port forwarding.
For the what is normally called ONE to ONE mapping (vice the above many to one), there is no port forwarding but FW rules are very much required.

Thus I differ from the above to help delineate what is going on and understandable. I would use one interface for my Main LAN, and I would use one interface for my LAN(s) and I would use other interfaces for my one to one mappings (one public IP to one private IP). The only instance where I would be lost is if I had less ports on the router(interfaces) then public IPs to deal with.
In that case agree one would have to learn how to combine these (more than one public IP) on a single interface. I would buy a router with more ports, much easier to think about, less stress :-)
 
User avatar
owk444
just joined
Topic Author
Posts: 2
Joined: Wed Apr 18, 2018 10:17 am
Location: Moscow
Contact:

Re: Port forwarding on non-interface IP [SOLVED]

Sat Apr 21, 2018 10:11 pm

Great thanks to all!

Really, after adding a secondary IP to the WAN interface all works fine!

Thank you and have nice day!

Who is online

Users browsing this forum: zalciukaz and 114 guests