sinet.com.kh

Saturday, January 20, 2018

Fail Over Configuration (PPPoE Client & Static IP)

1. Comment Interface
2. Create Bridge LAN
3. Configure PPPoE Client on WAN1
4. Configure IP Address for WAN2
5. Configure IP Address for Bridge LAN
6. Configure DNS Server
7. Configure DHCP Server
8. Configure Static Route
9. Configure NAT
10. Add Port to Bridge LAN

Note:
-We use 2LAN in this Configuration
-We use WAN2 for Active and WAN1 for Backup
-All 2LAN will configure on this practise
-When WAN2 is down, all 2LAN will work on WAN1

In this configuration we use MikroTik: 450G and Firmware 6.41
1. Comment Interface
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN1
set [ find default-name=ether2 ] name=ether2-WAN2
set [ find default-name=ether3 ] comment=Bridge-LAN1-Management
set [ find default-name=ether4 ] comment=Bridge-LAN2-Staff

 
2. Create Bridge LAN
/interface bridge
add fast-forward=no name=bridge-LAN1-Management
add fast-forward=no name=bridge-LAN2-Staff


3. Configure PPPoE Client on WAN1
/interface pppoe-client
add add-default-route=yes default-route-distance=0 disabled=no interface=\
    ether1-WAN1 name=pppoe-out1 password=12345678 user=pppoeacc@sinet.sbiz3

 
4. Configure IP Address for WAN2
/ip address
add address=96.9.76.99/25 interface=ether2-WAN2 network=96.9.76.0

 
5. Configure IP Address for Bridge LAN
/ip address
add address=192.168.1.1/24 interface=bridge-LAN1-Management network=192.168.1.0

 
6. Configure DNS Server
/ip dns
set servers=8.8.8.8,8.8.4.4

 
7. Configure DHCP Server
/ip dhcp-server network
add address=172.16.1.0/24 gateway=172.16.1.1
add address=192.168.1.0/24 gateway=192.168.1.1


/ip pool
add name=dhcp_pool0 ranges=192.168.1.100-192.168.1.254
add name=dhcp_pool1 ranges=172.16.1.100-172.16.1.254


/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=bridge-LAN1-Management name=dhcp1
add address-pool=dhcp_pool1 disabled=no interface=bridge-LAN2-Staff name=dhcp2

 
8. Configure Static Route
/ip route
add distance=1 gateway=96.9.76.1


9. Configure NAT
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether2-WAN2
add action=masquerade chain=srcnat out-interface=pppoe-out1

 
10. Add Port to Bridge LAN
/interface bridge port
add bridge=bridge-LAN1-Management interface=ether3
add bridge=bridge-LAN2-Staff interface=ether4 


Note: By Default Route Distance for PPPoE is 0 "Zero" and Default Route Distance for Static Route is 1 "One". If we want WAN2 (Static IP) for Active and WAN1 (PPPoE) for Backup. We need to change Default Route Distance for PPPoE to 2 "Two".


1 comment:

  1. How can I modify this to check for an external IP address ping instead of gateway IP? I have WAN1 as PPPoE and WAN2 as Static IP from ISP modem. At times the modem is up and running but ISP breaks. How can we detect that?

    ReplyDelete