MikroTik MTCNA lab 11 of 19
NAT: src-nat, masquerade, port forwarding, 1:1 NAT, redirect and hairpin
Publish an internal web server to the Internet with a port forward and a 1:1 NAT address, use src-nat instead of masquerade on a static WAN, force every DNS query through the router with redirect, and make the public address work from inside with hairpin NAT.
Run this lab
It needs Lite: its 5 nodes are set to 5 vCPU and 2,048 MB in total. That fits the free demo too.
In your workspace: Shared, then MikroTik MTCNA RouterOS v7 guided labs, then 11 - NAT - src-nat masquerade port forwarding 1 -1 NAT redirect and hairpin
- Level
- Intermediate
- Time
- About 60 minutes
- Nodes need
- 5 vCPU, 2,048 MB
- Smallest plan
- Lite
The scenario
An architects' practice has moved its project website onto its own server, Web1, in the office. Fernvale has given the practice a small block of public addresses, 203.0.113.0/29: the router uses .2, and .3 is reserved for Web1. The partners want the site reachable on the public address, the office PCs to keep browsing, and every DNS query to go through the router so that printer.office.example always works, even on laptops with a hard-coded public DNS server.
| Device | Interface | Address |
|---|---|---|
| GW | ether1 (WAN) | 203.0.113.2/29 and 203.0.113.3/29 |
| GW | ether2 (LAN) | 192.168.88.1/24 |
| ISP | ether1 · ether2 | 203.0.113.1/29 · 198.51.100.1/24 |
| Remote | eth0 | 198.51.100.10/24 (a visitor on the Internet; also runs a test web page) |
| Web1 | eth0 | 192.168.88.80/24 |
| Office-PC | eth0 | 192.168.88.20/24 |
What you’ll practise
- Choose between masquerade and src-nat
- Forward a public port to an internal server with dst-nat
- Give a server its own public address with 1:1 NAT (dst-nat plus src-nat)
- Redirect traffic to the router itself
- Explain why a port forward fails from inside, and fix it with hairpin NAT
- Read NAT rule counters and connection-table NAT flags
The tasks
- Prepare the hosts and their web pages
- Use src-nat on a static WAN
- Forward a port to Web1
- Give Web1 its own public address (1:1 NAT)
- Send every DNS query to the router (redirect)
- Make the port forward work from inside (hairpin NAT)
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- ISP
ether1to GWether1 - ISP
ether2to Remoteeth0 - GW
ether2to Office-LAN (network) - Web1
eth0to Office-LAN (network) - Office-PC
eth0to Office-LAN (network)
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| ISP | MikroTik RouterOS | mikrotik-7.14.2 | 1 vCPU, 256 MB |
| GW | MikroTik RouterOS | mikrotik-7.14.2 | 1 vCPU, 256 MB |
| Remote | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
| Web1 | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
| Office-PC | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
MikroTik MTCNA RouterOS v7 guided labs.Open
11 - NAT - src-nat masquerade port forwarding 1 -1 NAT redirect and hairpinand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More MikroTik MTCNA labs
Related labs in other courses
CloudLabBox is independent of MikroTik. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.