Rabu, 03 April 2013

MikroTik Dual Gateway Failover

Scenario:
This example will show how to configure a MikroTik Router with a secondary WAN port for failover in the case of redundancy if the primary WAN port goes down.



Setting up the primary WAN port:
/ip address add address=1.1.1.1/30 interface=ether1 comment="primary wan" disabled=no


Setting up the Secondary failover WAN port:
/ip address add address=2.2.2.2/30 interface=ether2 comment="failover wan" disabled=no 

Setup DNS: /ip dns set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4

Assign an IP Address to ether3 for the internal network: /ip address add address=192.168.1.1/24 interface=ether3 comment="internal network" disabled=no

Configure a DHCP Server for your network:
/ip dhcp-server setup 
Select interface to run DHCP server on 

dhcp server interface: ether3

Select network for DHCP addresses 

dhcp address space: 192.168.1.0/24

Select gateway for given network 

gateway for dhcp network: 192.168.1.1

Select pool of ip addresses given out by DHCP server 

addresses to give out: 192.168.1.2-192.168.1.254

Select DNS servers 

dns servers: 192.168.1.1

Select lease time 

lease time: 3d



Configuring NAT for Internet Access:

/ip firewall nat add chain=srcnat action=masquerade comment="nat internet access" disabled=no

Setup the default routes and have the router check the main WAN port. If the router does not receive a response then route traffic out the failover WAN port:
/ip route add dst-address=0.0.0.0/0 gateway=1.1.1.1 check-gateway=ping distance=1 disabled=no
/ip route add dst-address=0.0.0.0/0 gateway=2.2.2.2 distance=2 disabled=no


Finish
may be useful


Regards
Merah Putih Segoroasat
Thanks

Tidak ada komentar :

Posting Komentar