Community discussions

MUM Europe 2020
 
fabrix
newbie
Topic Author
Posts: 30
Joined: Fri Apr 19, 2013 10:48 pm

Share 1 Gateway for 2 subnet

Mon Sep 16, 2013 10:53 pm

Hello to all,

I just started to use the products and Mikrotik would like to have some help on the following configuration.
I have a Gateway 192.168.1.1 (A) for internet and type 2 networks 172.16.1.0/16 (B) and 192.168.2.0/24 (C).
I want to share the internet access(A) to networks B and C, using a RB433.
This is my configuration:
/ip address
add address = 192.168.1.254/24 interface = Ether1
add address = 192.168.2.1/24 interface = ether2
add address = 172.16.0.0/16 interface = Ether3
/ip route
add dst-address = 0.0.0.0 / 0 gateway = 192.168.1.1
/ip firewall nat
add chain = srcnat out-interface = Ether1-gateway action = masquerade

Do you think this configuration is correct?

Thank you all for your attention.

Fabrix
 
tws101
Member Candidate
Member Candidate
Posts: 284
Joined: Thu Sep 08, 2011 11:25 pm

Re: Share 1 Gateway for 2 subnet

Mon Sep 16, 2013 11:53 pm

Yes it will work.. You need DHCP setup as well as a decision as to whether you want routing between your local subnets but yes it should work.
 
kashifmac2005
newbie
Posts: 28
Joined: Thu Aug 22, 2013 9:27 pm

Re: Share 1 Gateway for 2 subnet

Tue Sep 17, 2013 8:10 pm

brother your setting concept is correct but if you are using terminal then verify your gateway interface name because in ip address interface name is ether1 but in nat rule at out-interface name is Ether1-gateway maybe you mentioned "-gateway" for explanation.
Hello to all,
/ip address
add address = 192.168.1.254/24 interface = Ether1
/ip firewall nat
add chain = srcnat out-interface = Ether1-gateway action = masquerade

Do you think this configuration is correct?

Thank you all for your attention.

Fabrix
 
fabrix
newbie
Topic Author
Posts: 30
Joined: Fri Apr 19, 2013 10:48 pm

Re: Share 1 Gateway for 2 subnet

Tue Sep 17, 2013 10:54 pm

I am grateful for having responded.
Yes, it works.
I would like to create routes to allow operation between subnets (A) and (B).
Can someone help me?
Thanks to everyone
 
fabrix
newbie
Topic Author
Posts: 30
Joined: Fri Apr 19, 2013 10:48 pm

Re: Share 1 Gateway for 2 subnet

Tue Sep 17, 2013 10:56 pm

For kashifmac2005
Yes,is a typing error.

Thank you
 
tws101
Member Candidate
Member Candidate
Posts: 284
Joined: Thu Sep 08, 2011 11:25 pm

Re: Share 1 Gateway for 2 subnet

Wed Sep 18, 2013 12:16 am

By default Mikrotik allows communication between subnets. This is on Layer 3.

Layer 2 will not work between the subnets. (Anything that requires a broadcast)

You can restrict Layer 3 as well by adding a firewall filter rule Chain Forward Action Drop and specify source and destination addresses.
 
deejayq
Member Candidate
Member Candidate
Posts: 195
Joined: Wed Feb 23, 2011 8:33 am

Re: Share 1 Gateway for 2 subnet

Wed Sep 18, 2013 11:04 am

add address = 172.16.0.0/16 interface = Ether3
you have a typo, it should be 172.16.0.1/16
 
fabrix
newbie
Topic Author
Posts: 30
Joined: Fri Apr 19, 2013 10:48 pm

Re: Share 1 Gateway for 2 subnet

Wed Sep 18, 2013 11:48 pm

Yes

Who is online

Users browsing this forum: No registered users and 49 guests