Community discussions

MikroTik App
 
spaxton
Member Candidate
Member Candidate
Topic Author
Posts: 192
Joined: Fri Jan 01, 2010 12:18 pm

Routing multiple static address

Wed Dec 03, 2014 11:44 am

Dear all,

I have searched forum before posting this and I have found similar thing but there were nothing to explain how to do next thing:

I have 3 subnets in my mikrotik router and one ISP able to give 3 public addresses via single interface. For ISP I am using one of 3 ethernet ports.
Subnets are 192.168.1.0/24 for wifi
10.100.0.0/24 one group of PCs
10.10.0.0/24 second group of PCs

What I need is to separate public IPs for all 3 subnets. Wifi should go to one and those two subnets to other two. How to do this if public IPs are all in the same interface?

Best Regards!
 
User avatar
rmmccann
Member Candidate
Member Candidate
Posts: 182
Joined: Tue Sep 25, 2012 11:15 pm
Location: USA

Re: Routing multiple static address

Wed Dec 03, 2014 4:57 pm

Assign the 3 public IP addresses from your ISP to your MT. From there, create srcnat rules and don't use action=masquerade. Use action=srcnat. Doing this will allow you to specify which public IP should be used for each subnet.

Eg:
/ip firewall nat
add action=src-nat chain=srcnat comment="Subnet 1" out-interface=WAN src-address=192.168.1.0/24 to-addresses=x.x.x.x
add action=src-nat chain=srcnat comment="Subnet 2" out-interface=WAN src-address=10.10.0.0/24 to-addresses=x.x.x.y
add action=src-nat chain=srcnat comment="Subnet 3" out-interface=WAN src-address=10.100.0.0/24 to-addresses=x.x.x.z

The x.x.x IPs are the IPs that would be provided by your ISP.
 
spaxton
Member Candidate
Member Candidate
Topic Author
Posts: 192
Joined: Fri Jan 01, 2010 12:18 pm

Re: Routing multiple static address

Wed Dec 03, 2014 11:40 pm

Assign the 3 public IP addresses from your ISP to your MT. From there, create srcnat rules and don't use action=masquerade. Use action=srcnat. Doing this will allow you to specify which public IP should be used for each subnet.

Eg:
/ip firewall nat
add action=src-nat chain=srcnat comment="Subnet 1" out-interface=WAN src-address=192.168.1.0/24 to-addresses=x.x.x.x
add action=src-nat chain=srcnat comment="Subnet 2" out-interface=WAN src-address=10.10.0.0/24 to-addresses=x.x.x.y
add action=src-nat chain=srcnat comment="Subnet 3" out-interface=WAN src-address=10.100.0.0/24 to-addresses=x.x.x.z

The x.x.x IPs are the IPs that would be provided by your ISP.
Thanks, friend! I'll try this.

Who is online

Users browsing this forum: No registered users and 101 guests