fbpx

Chapter 3.5 – Source NAT

Source NAT

MikroTik Firewall SRCNAT

Network Address Translation (NAT) allows hosts on a LAN to communicate with external networks.

  • Source NAT (srcnat) translates IP addresses (from a LAN) to public IP addresses when accessing the Internet. It also performs public to private IP translation when traffic is generated from the WAN to a LAN.
  • Non-Publicly Routable IP addresses are IP addresses that cannot be used on the Internet.
      • These private addresses are:
            • 10.0.0.0/8
            • 172.16.0.0/12
            • 192.168.0.0/16

masquerade & src-nat

The first chain for NAT is srcnat. It is used to apply actions to outgoing data from the router. Like firewall filters, NAT rules have some properties and actions (13 actions). The first and most basic action of NAT is action=masquerade.

masquerade replaces the source IP address in packets with another specific IP (for example, a private to public one) to facilitate routing.

  • Typically, the source IP address of packets going to the Internet will be replaced by the address of the external interface (WAN).

chain=src-nat allows you to make changes to the IP address and source port of the packets to those specified by the network administrator

MikroTik Firewall Filter action masquerade

Usage example:

Two companies (alpha and beta) have merged, but there is a problem on their local networks since both networks use the same address space (for example, 172.16.0.0/16.). They do not want to change their network segments, since all the devices in the company (printers, projectors, copiers, etc.) have assigned addresses and it would involve loss of time.

Solution: Focusing on the concept of NAT, the only thing that will be required are basic NAT rules with src-nat and possibly rules of dst-nat, regardless of whether the local networks of each one are the same.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

Leave your comment

Your email address will not be published. Required fields are marked with *

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011