

log - add a message to the system log containing following data: in-interface, out-interface, src-mac, protocol, src-ip:port->dst-ip:port and length of the packet.jump - jump to the user defined chain specified by the value of jump-target parameter.dst-nat - replaces destination address and/or port of an IP packet to values specified by to-addresses and to-ports parameters.add-src-to-address-list - add source address to Address list specified by address-list parameter.add-dst-to-address-list - add destination address to Address list specified by address-list parameter.When action=srcnat is used instead, connection tracking entries remain and connections can simply resume.Īction to take if packet is matched by the rule: You can workaround this by creating blackhole route as alternative to route that might disappear on disconnect). primary link comes back, routing is restored over primary link, so packets that belong to existing connections are sent over primary interface without being masqueraded leaking local IPs to a public network.next packet from every purged (previously masqueraded) connection will come into firewall as connection-state=new, and, if primary interface is not back, packet will be routed out via alternative route (if you have any) thus creating new connection.on disconnect, all related connection tracking entries are purged.In such scenario following things can happen: Unfortunately this can lead to some issues when action=masquerade is used in setups with unstable connections/links that get routed over different link when primary is down.

To overcome these limitations RouterOS includes a number of so-called NAT helpers, that enable NAT traversal for various protocols.įirewall NAT action=masquerade is unique subversion of action=srcnat, it was designed for specific use in situations when public IP can randomly change, for example DHCP-server changes it, or PPPoE tunnel after disconnect gets different IP, in short - when public IP is dynamic.Įvery time interface disconnects and/or its IP address changes, router will clear all masqueraded connection tracking entries that send packet out that interface, this way improving system recovery time after public ip address change. Moreover, some protocols are inherently incompatible with NAT, a bold example is AH protocol from the IPsec suite. Services that require the initiation of TCP connection from outside the private network or stateless protocols such as UDP, can be disrupted.

Therefore some Internet protocols might not work in scenarios with NAT. Hosts behind a NAT-enabled router do not have true end-to-end connectivity. A NAT router performing dstnat replaces the destination IP address of an IP packet as it travel through the router towards a private network. It is most comonly used to make hosts on a private network to be acceesible from the Internet. This type of NAT is performed on packets that are destined to the natted network. A reverse operation is applied to the reply packets travelling in the other direction. A NAT router replaces the private source address of an IP packet with a new public IP address as it travels through the router. This type of NAT is performed on packets that are originated from a natted network. The NAT gateway (NAT router) performs IP address rewriting on the way a packet travel from/to LAN. For NAT to function, there should be a NAT gateway in each natted network. A LAN that uses NAT is referred as natted network. Network Address Translation is an Internet standard that allows hosts on local area networks to use one set of IP addresses for internal communications and another set of IP addresses for external communications.
