Community discussions

MikroTik App
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 2:24 pm

Hi can someone please help me with routing please. I have 2 rb433's and one rb411.

IP setup is like this

Router1
- eth1(192.168.0.10/24)
- wlan1(192.168.2.1/24)

Router2
- eth1(192.168.200.1/24)
- wlan1(192.168.2.2/24)
- wlan2(192.168.3.1/24)

Router1
- eth1(192.168.160.1/24)
- wlan1(192.168.3.2/24)

What i want to do is to enable users on any /24 network to ping each other and share data and so on.
The setup that i tried looks like this.

Router1 routelist= dst network = 0.0.0.0/0 gateway = 192.168.2.2
Router2 routelist= dst network = 0.0.0.0/0 gateway = 192.168.2.1
Router2 routelist= dst network = 0.0.0.0/0 gateway = 192.168.3.2
Router3 routelist= dst network = 0.0.0.0/0 gateway = 192.168.3.1

I have a computer on 192.168.0.10/24, i want everyone on my wan to connect to that server for dns requests. But only allow certian computers(mac addresses) to connect to the internet.

Can someone hrlp me?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 2:40 pm

If Router2 is a gateway to internet then

R1 and R3 routes are correct

On R2 should be following routes

/ip route
add dst-address=192.168.0.0/24 gateway=192.168.2.1
add dst-address=192.168.160.0/24 gateway=192.168.3.2

add gateway=xx.xx.xx.xx

where xx.xx.xx.xx is your ISPs gateway.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 2:43 pm

IP setup is like this

Router1
- eth1(192.168.0.10/24) internet gateway
- wlan1(192.168.2.1/24) wireless to router2

Router2
- eth1(192.168.200.1/24) localnet
- wlan1(192.168.2.2/24) wireless to router1
- wlan2(192.168.3.1/24) wireless to router3

Router3
- eth1(192.168.160.1/24) localnet
- wlan1(192.168.3.2/24) wireless to router2
I modified this a little to show what each interface does. Is this correct?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 2:56 pm

Hi yes it is correct.for example what i want to do is allow computer on router3(eth1 = 192.168.160.4) to see computer on router1(192.168.0.22) and vise versa. Im starting a wireless group and will have alot of nodes conencting(mikrotik and non-mikrotik). That is why i need to allow anyone on any router to see each other.


Router1
- eth1(192.168.0.10/24) internet gateway
- wlan1(192.168.2.1/24) wireless to router2

Router2
- eth1(192.168.200.1/24) localnet
- wlan1(192.168.2.2/24) wireless to router1
- wlan2(192.168.3.1/24) wireless to router3

Router3
- eth1(192.168.160.1/24) localnet
- wlan1(192.168.3.2/24) wireless to router2[/quote]
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 3:02 pm

No problem!

Insure the only NAT is in router1:
/ip firewall nat
add chain=srcnat action=masquerade out-interface=ether1

In router1:
/ip route
add gateway=192.168.0.1
add dst-address=192.168.3.0/24 gateway=192.168.2.2
add dst-address=192.168.200.0/24 gateway=192.168.2.2
add dst-address=192.168.160.0/24 gateway=192.168.2.2

In router2:
/ip route
add gateway=192.168.2.1
add dst-address=192.168.160.0/24 gateway=192.168.3.2

In router3
/ip route
add gateway=192.168.3.1
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:00 pm

Thank you very much, im unable to ping from 192.168.0.x/24 to 192.168.2.x. But im able to ping from 192.168.2.x/24 to 192.168.0.x/24.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:05 pm

That is correct! The way you described your network, the 192.168.0.x net is your public interface. That is why there is a NAT there. Is there something else about your network I don't know?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:08 pm

Yes on 192.168.0.0/24 there is also computers. I have a proxy server on 192.168.0.0/24 that i want to use as dns server for the wan.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:13 pm

No problem there either. However, I may not be able to help with routing in a non-Mikrotik router.

Just continue the same routing pattern on the router that isolates your localnets from the internet, and remove the NAT from router1 and put it in that router (router0?).
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:23 pm

Thank you. Sorry for asking can you please tell me what i must add so that i can ping from 192.168.0.0/24.

Or is it impossible?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:25 pm

How is the 192.168.0.x/24 net separated from the internet? Is there another router or some other device that does a route/NAT for your localnet?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:28 pm

I have setup a firewall/proxy server(192.168.0.14) that filters all internet traffice and also controlls port mapping and firewall rules. The firewall conencts to a dsl router.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:34 pm

I don't know about that device, but if it was a Mikrotik router:
/ip route
add dst-address=192.168.2.0/24 gateway=192.168.0.10
add dst-address=192.168.3.0/24 gateway=192.168.0 10
add dst-address=192.168.200.0/24 gateway=192.168.0.10
add dst-address=192.168.160.0/24 gateway=192.168.0.10

...and remove the NAT from router1
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:39 pm

I don't know about that device, but if it was a Mikrotik router:
/ip route
add dst-address=192.168.2.0/24 gateway=192.168.0.10
add dst-address=192.168.3.0/24 gateway=192.168.0 10
add dst-address=192.168.200.0/24 gateway=192.168.0.10
add dst-address=192.168.160.0/24 gateway=192.168.0.10

Must i add that to router1?

Thanx for all the advice and answers. one more thing. i am able to ping wlan1/eth1 on router1 from router2 but cannot ping wlan1 or eth1(router2) from eth1 on router1.

i can ping router2 from router1 wlan1
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:43 pm

Nothing needs to be changed from what I gave you above for router1, router2, and router3. Only router0 needs those route additions. And router0 must do the srcnat to your public ip.
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:45 pm

Ok thanx so what you telling me is that router0(eth1) wont be able to ping any of the interfaces on the other routers?

Becos im unable to ping wlan1 on router2 from eth1 on router1
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:51 pm

You cannot ping, or anything else, to any ip through router1 (like 192.168.2.1, 192.168.3.1, etc) from any 192.168.0.x/24 address until you install the new routes in router0 and remove the NAT from router1.
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 4:52 pm

Thank you very much for that info. I have been searching everywhere for that answers and finally got it. Thanx you for helping me out my nightmares. Thanx again :D
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 5:27 pm

You are very welcome! I really like the name of your city. I am going to Google Earth it now!
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Tue Dec 15, 2009 6:29 pm

yes its s nice place, about 80km from the sea. But it can get very hot here, about 41'c in the summer
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 10:29 am

Everything is working great,the only problem that i have now is that the internet does not work. i can ping 192.168.10.200 but there is no internet. The reason might be becos 192.168.10.0/24 cant ping 192.168.200.0/24
 
xezen
Long time Member
Long time Member
Posts: 628
Joined: Fri May 30, 2008 10:23 am
Location: South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 11:27 am

so all is working now or not?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 1:03 pm

Why is routing so confising?

Here is a new example that i want to try.

router1(office)

eth1[192.168.0.10/24]
eth2[192.168.10.1/24]
bridge1(wlan1+2+3)[192.200.0.1/24]


router2(my house)

eth1[192.168.200.1/24]
bridge1(wlan1+2+3)[192.100.0.1/24]

router3(other house)

eth1[192.168.50.1/24]
bridge1(wlan1+2+3)[192.20.0.1/24]


ps:both house router and other house router connects directly to office router. My house router connects using wlan1 and other house use wlan2


For example my picture router2 <-----> router1 <------> router3

On router 1 there is a non-mikrotik router(192.168.10.200) and the interface is eth2[192.168.10.1/24]

How can i setup routing corrctly so that they can ping each other and also use 192.168.10.200 and internet gateway for internet?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 1:53 pm

For example my picture router2 <-----> router1 <------> router3

On router 1 there is a non-mikrotik router(192.168.10.200) and the interface is eth2[192.168.10.1/24]

How can i setup routing correctly so that they can ping each other and also use 192.168.10.200 and internet gateway for internet?
That is not how you described your network. I thought it was
internet/router0 <--> router1 <--> router2 <--> router3
I did not include any routing for the 192.168.10.x/24 net. Where in this network is that?
From the internet, you will not be able to ping past the interface with the srcnat into your localnets. Where is your srcnat now? Should be router0.
Can you ping 192.168.0.1 from all localnets? That is the "gateway" interface for your network, correct?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 2:14 pm

Sorry for the confusion. the first one was my test mikrotik that i first was testing how to setup routing.

This one that i want to do now is the real one.

Is is like this

router3(jack's house) <----> router1(office){internet} ----router2(my house)


router1(office)

eth1[192.168.0.10/24]
eth2[192.168.10.1/24]
bridge1(wlan1+2+3)[192.200.0.1/24]


router2(my house)

eth1[192.168.200.1/24]
bridge1(wlan1+2+3)[192.100.0.1/24]

router3(jack's house)

eth1[192.168.50.1/24]
bridge1(wlan1+2+3)[192.20.0.1/24]

On eth2(router1) there is a dns server(proxy/firewall/dns). The ip is 192.168.10.200. That is also the gateway where all internet traffic passes through.

When i setup routing then i am able to ping to 192.168.10.200 but not able to ping any interface or mikrotik networks exept eth2 from 192.168.10.200
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 2:19 pm

On eth2(router1) there is a dns server(proxy/firewall/dns). The ip is 192.168.10.200. That is also the gateway where all internet traffic passes through.

When i setup routing then i am able to ping to 192.168.10.200 but not able to ping any interface or mikrotik networks exept eth2 from 192.168.10.200
Do you have these new routes (and the srcnat) installed in router0?
/ip route
add dst-address=192.168.2.0/24 gateway=192.168.0.10
add dst-address=192.168.3.0/24 gateway=192.168.0 10
add dst-address=192.168.200.0/24 gateway=192.168.0.10
add dst-address=192.168.160.0/24 gateway=192.168.0.10
ADD: And from the 192.168.10.x net (internet), you cannot ping through the interface with the srcnat. You will need to move the srcnat, and add new routes to router-1. That is the router between router0 and the internet.
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 2:32 pm

not yet. i have ipcop server, will try to set it up quickly
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 2:54 pm

If you have changed your network, you will need to edit all the routes I gave you in order to send the packets out the correct interface in each router.
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 3:04 pm

i was able to setup routing in router0.

the code is route add -net 192.168.200.0 gw 192.168.10.1 netmask 255.255.255.0

Now i can ping 192.168.200.x

thnax for all your help. you helped me alot
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 3:11 pm

You can access the internet from all localnets too?
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 3:53 pm

Stil have a small dns problem which i will sort out later. I am able to ping both ways from my server and from the mikrotik.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Need help with setting up routing between 3 mikrotiks.

Thu Dec 17, 2009 4:31 pm

In all your Mikrotik routers, insure under
/ip dns
you have "allow-remote-requests=yes"
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Fri Dec 18, 2009 7:56 am

Cool i will try that and let you know if it works. One more thing that i want to know is when my pc at home connect to internet will i be connecting with my computer's mac address or router1 mac address?

Becos i only want to allow certian computer on wan to connect to internet(eth1), but want everyone to use the server as dns.

At the moment im using eoip and all thhe computers are on same ip range(172.19.85.0/24), and when they connect to dns server then it shows that it is connecting by using the onboard lan card mac address and not router1 or router2.
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Fri Dec 18, 2009 8:59 am

The mikrotik setup is correct and working, but stil have problem with dns. I have posted a new question on their forum asking them what i can do.

http://www.ipcops.com/phpbb3/viewtopic. ... 342#p73342
 
User avatar
kameelperdza
Member
Member
Topic Author
Posts: 468
Joined: Thu Nov 27, 2008 11:45 am
Location: Oudtshoorn, South Africa

Re: Need help with setting up routing between 3 mikrotiks.

Thu Jan 28, 2010 4:39 pm

Hi there i have connected a new router to router 3. I can ping that new router from any ip on the wifi but cannot ping and ip's on the eth1(router1) from the new router. So i added natting with masquarade.

Will is cause problems if there is also natting on router 1 and the ipcop firewall?

PS: Router1 is connected to the firewall. And the firewall is doing its own natting. I only added natting to router 1 so that i can ping the radius server on router1.(ether2 interface)

Will routing and mangle rules still help or will natting on router 1 cause security problems?

thanx

Who is online

Users browsing this forum: jhbarrantes, xrlls and 37 guests