Community discussions

MikroTik App
 
gplank
just joined
Topic Author
Posts: 1
Joined: Thu May 03, 2012 7:43 pm

address translation by interface

Thu May 03, 2012 8:21 pm

Hello-

First post. RouterOS 5.15 on routerboard 4000 series.

In a source NAT configuration, is there any way to match source addresses for all the addresses on an interface, without explicitly writing the address range? I would like to be able to change the IP of an interface without having to change firewall settings.

In other words, I have an interface bridge1 for subnet 192.168.2.0/24, and my current settings are:
/ip firewall nat add chain=srcnat action=masquerade src-address=192.168.2.0/24

...but instead I would like to use something like
/ip firewall nat add chain=srcnat action=masquerade src-address=bridge1

I tried using src-address-type=local but that appears to only match the addresses of the router's interfaces, but not the addresses on the interfaces' subnets.

Thanks,
Gabe
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: address translation by interface

Thu May 03, 2012 8:42 pm

You could use the in-interface and out-interface options.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: address translation by interface

Thu May 10, 2012 5:57 pm

what is the goal? the most correct variant is
/ip firewall nat add chain=srcnat out-interface=Internet action=masquerade

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 192 guests