Super noob questions

Hello,

I’m Tim, a sys admin but not a network man.

I’m trying to dealing with mikrotik and mikrotik-based networks on my new job but i need seriously help.

There are to case that i must handle;

First -and the basic one;

There are a one internet line on CAT5, one RB600 Board, one laptop and one DNS/syslog server on my desk. I need to;

  • Mikrotik should access to internet over ether1 with 10.0.1.1/24 IP block ( I want to give a static IP )
  • DNS Server should access to internet and the laptop over ether2
  • Laptop should access to internet and DNS server over ether3
  • DNS and laptop must use same IP block ( 95.0.147.1/24 )

The second case is much more complicated. At least for me;

There is a mikrotik and 1 ADSL and 1 ethernet line that connected to Mikrotik ( i can’t see the system yet ). ADSL is backup line. I need to switch automatically that lines when the main line is gone to backup and restore to main line when the line get back.

How ?

I’m in a little bit hurry. Please guide me for the cases.

Thank you.

As far as failover goes, there are several options available, it all comes down to what you want to do, Load Balance, Policy based routing, or just simple failover:
http://wiki.mikrotik.com/wiki/Two_gateways_failover
http://wiki.mikrotik.com/wiki/ECMP_load_balancing_with_masquerade
http://wiki.mikrotik.com/wiki/Manual:PCC
There are several other examples on the Wiki and throughout the forum.

Each interface on the MikroTik is its own separated routed interface. This means is by setting up IP addresses on each interface, it will automatically handle all routing between them. Since your Laptop and DNS servers are going to be sharing the same subnet, the MikroTik doesn’t need to do any routing there. The Laptop will see that those addresses are part of the local subnet and will reach them automatically assuming they are on the same layer2 network.

Assigning a static IP address and giving it a default route is very easy to do:

/ip address add interface=ether3 address=10.0.1.2/24
/ip route add gateway=10.0.1.1 dst-address=0.0.0.0/0

If you could place the ADSL modems into bridge mode and get their public IP addresses directly assigned to the MikroTik it would probably be best so that you can avoid doing too much NAT.

Hi Feklar,

Thanks your reply.

I figure out a few things and my laptop and the server can be able to reach each other. Also mikrotik can connect to internet but laptop and DNS server can’t.

I need to get online those machines over ether1.

ether1 use 10.0.1.120 and others getting IP’s from another block (like 95.0.147.x)

What should i do ?

You are most likely going to have to set up a NAT rule to masquerade out of. Since your WAN has a private IP, it will not be able to take a public IP and route it out.

/ip firewall nat
add chain=src-nat action=masquerade out-interface=ether1

Since you have to do that, I doubt anyone will be able to reach your public IP addresses, the best solution would be to put your ADSL modems into bridge mode and see if you can get public IP addresses off of your ISP, most likely via PPPoE, and have them set up routes to your Public Subnet.

Hi again,

Thanks Feklar. Your explanations did very help. But the story change a bit.

We have RB750G and two DLS line ( one of ADSL and the other one G.SHDSL ). I need to connect both of them to Mikrotik as Bridge mode and need to set G.SHDSL line as main and the ADSL line as backup.

For the current situation; when we connect just G.SHDSL i can ping and connect to the mikrotik from outside but when we connect to ADSL line, everything goes down.

We also try “two gateway failover” method but nothing change.

Can you help me about exact procedure for this ?

ADSL line have dynamic IP btw. Our stupid ISP couldn’t set it with static IP.

Please post the results of

/ip router print detail

What I am guessing is going on, is since you are geting a route from DHCP, you have the DHCP client automatically add in the route for that, this defaults to a weight of one, so if your other routes have a higher weight, then as soon as it sees the link as up, the DHCP route takes over. You can specify this route to have a higher weight so it will not take over unless there is a down event on the other line.

As for the exact steps for setting up failover, things get a bit trickier when you get the addresses via DHCP, you can always remove the option to have the router automatically add in a default gateway and make your own static routes, this just assumes that you will always get an address in the same subnet. What kind of failover are you looking for? Just simple, would you like to use the backup line for specific kinds of traffic, or would you like to load balance the two lines? All 3 of these options would get you failover, but the last two would make it so you have more bandwidth available to offer to end users.

DHCP addresses rarely change for the most part as long as it is an active lease, it’s just annoying to deal with for the most part. If you are worried about it, you can set something up with DDNS, or you can write a script that will have the router send you an e-mail with it’s new IP when it gets one. With these two options you will at least always hopefully know what your IP address is or a way to get to it.