Page 1 of 1
how to output two lan ip address with the same wan
Posted: Tue Mar 24, 2015 11:35 am
by wilsongamo
i have two ip adress on the same interface 14.0/24 AND 15.0/24 i wanted to know can;i do for these ip adress come out by a same wan ip 172.168.0.1
thanks
Re: how to output two lan ip address with the same wan
Posted: Tue Mar 24, 2015 3:32 pm
by wilsongamo
the ip wan of the first routeur[ lan1 192.168.14.0/24 and lan2 192.168.15.0/24 ] is 172.0.1.1
the second routeur had this wan 172.0.1.2 and lan is 192.168.24.1.
for my first routeur i can go the second but from my second i just go to 192.168.14.0/24
please help and excuse my english
Re: how to output two lan ip address with the same wan
Posted: Tue Mar 24, 2015 4:54 pm
by ageofice
add a masquerade rule for both networks 192.168.14.0/24 and lan2 192.168.15.0/24 with out interface set to interface that you have 172.0.1.1 address configured on.
Re: how to output two lan ip address with the same wan
Posted: Tue Mar 24, 2015 4:57 pm
by ZeroByte
If you want full connectivity between all 3 lans and without NAT - you need to create static routes on the Mikrotiks.
And of course you also want to make sure NAT does not happen.
Finally you'll want to make sure the filter table does not block the traffic between the subnets.
On router one:
/ip route add dst=192.168.24.0/24 gateway=172.0.1.2
/ip firewall nat
add chain=srcnat dst=192.168.24.0/24 action=accept
/ip firewall filter
add chain=forward dst=192.168.24.0/24 action=accept
add chain=forward src=192.168.24.0/24 action=accept
On router two:
/ip route
add dst=192.168.14.0/24 gateway=172.0.1.1
add dst=192.168.15.0/24 gateway=172.0.1.1
/ip firewall nat
add chain=srcnat dst=192.168.14.0/24 action=accept
add chain=srcnat dst=192.168.15.0/24 action=accept
/ip firewall filter
add chain=forward dst=192.168.14.0/24 action=accept
add chain=forward src=192.168.14.0/24 action=accept
add chain=forward dst=192.168.15.0/24 action=accept
add chain=forward src=192.168.15.0/24 action=accept
That should give you full connectivity. If your routers are not running NAT or filters, then only the static routes are required. Of course, for internet access, the Internet router will also need static routes to these 3 subnets as well if you're not using NAT. (I recommend only using NAT at the Internet router)
Re: how to output two lan ip address with the same wan
Posted: Wed Mar 25, 2015 10:01 am
by wilsongamo
i try but ist not working
with the old configuration I had this
ping 192.168.14.0/24 TO 192.168.24.0/24 OK
ping 192.168.15.0/24 TO 192.168.24.0/24 OK
ping 192.168.24.0/24 TO 192.168.14.0/24 OK
ping 192.168.24.0/24 TO 192.168.15.0/24 Bad Bad Bad
ip firewall chain=srcnat action=src-nat to adress=172.0.1.1
Re: how to output two lan ip address with the same wan
Posted: Wed Mar 25, 2015 4:02 pm
by ZeroByte
If you can ping 15 -> 24 ok, but 24 -> 15 fails, this means that either there is NAT involved or else a filter rule is blocking the traffic.
Again:
Remove all NAT for these sources/destinations. If you need NAT to reach between the sites, then something is wrong with the routing tables of your routers (or the network in the middle is blocking direct communications between R1/R2).
Make sure that both routers show the correct next hop for each subnet.
On the router with .14.x and .15.x local subnets, next hop for 24.x should be 172.0.1.2
Make sure this route is active and enabled, and that there is no other thing like routing marks, vrf, or more specific route that will interfere.
Make sure that there is no filter rule that is dropping the packets.
If it still does not work, then for both routers, post the output from these commands:
/ip address print
/ip route print
/ip firewall nat export compact
/ip firewall filter export compact
And please if you must alter the content, only modify any public IP addresses shown, and not the private ones.
Re: how to output two lan ip address with the same wan
Posted: Wed Mar 25, 2015 4:43 pm
by TomosRider
Just check your firewall/nat....
Re: how to output two lan ip address with the same wan
Posted: Thu Apr 02, 2015 2:17 pm
by wilsongamo