sinet.com.kh

Saturday, June 29, 2019

Load Sharing 2 WAN and 6 LAN by using Vlan

In this configuration we will show you how to configure Load Sharing 2 WAN and 6 LAN by using Vlan. We use Mikrotik

Network Diagram
1. Comment Interface
2. Create Bridge-Vlan
3. Create Vlan
4. Configure IP Address for WAN
5. Configure IP Address for LAN
6. Configure DNS Server
7. Configure DHCP Server
8. Configure IP Address Lists
9. Configure Mark Routing
10. Configure Static Route
11. Configure NAT
12. Add Port to Bridge-Vlan

Network Diagram


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="# LAN"
2. Create Bridge-Vlan
/interface bridge
add fast-forward=no name=bridge-VLAN
3. Create Vlan
/interface vlan
add interface=bridge-VLAN name=vlan10 vlan-id=10
add interface=bridge-VLAN name=vlan11 vlan-id=11
add interface=bridge-VLAN name=vlan12 vlan-id=12
add interface=bridge-VLAN name=vlan20 vlan-id=20
add interface=bridge-VLAN name=vlan21 vlan-id=21
add interface=bridge-VLAN name=vlan22 vlan-id=22
4. Configure IP Address for WAN
/ip address
add address=96.9.74.110/24 interface=ether1-WAN1 network=96.9.74.0
add address=203.217.170.111/24 interface=ether2-WAN2 network=203.217.170.0
5. Configure IP Address for LAN
/ip address
add address=10.10.10.1/24 interface=vlan10 network=10.10.10.0
add address=10.10.11.1/24 interface=vlan11 network=10.10.11.0
add address=10.10.12.1/24 interface=vlan12 network=10.10.12.0
add address=10.10.20.1/24 interface=vlan20 network=10.10.20.0
add address=10.10.21.1/24 interface=vlan21 network=10.10.21.0
add address=10.10.22.1/24 interface=vlan22 network=10.10.22.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=10.10.10.0/24 gateway=10.10.10.1
add address=10.10.11.0/24 gateway=10.10.11.1
add address=10.10.12.0/24 gateway=10.10.12.1
add address=10.10.20.0/24 gateway=10.10.20.1
add address=10.10.21.0/24 gateway=10.10.21.1
add address=10.10.22.0/24 gateway=10.10.22.1

/ip pool
add name=dhcp_pool1 ranges=10.10.10.10-10.10.10.254
add name=dhcp_pool2 ranges=10.10.11.10-10.10.11.254
add name=dhcp_pool3 ranges=10.10.12.10-10.10.12.254
add name=dhcp_pool4 ranges=10.10.20.10-10.10.20.254
add name=dhcp_pool5 ranges=10.10.21.10-10.10.21.254
add name=dhcp_pool6 ranges=10.10.22.10-10.10.22.254

/ip dhcp-server
add address-pool=dhcp_pool1 authoritative=after-2sec-delay disabled=no interface=vlan10 name=dhcp1
add address-pool=dhcp_pool2 authoritative=after-2sec-delay disabled=no interface=vlan11 name=dhcp2
add address-pool=dhcp_pool3 authoritative=after-2sec-delay disabled=no interface=vlan12 name=dhcp3
add address-pool=dhcp_pool4 authoritative=after-2sec-delay disabled=no interface=vlan20 name=dhcp4
add address-pool=dhcp_pool5 authoritative=after-2sec-delay disabled=no interface=vlan21 name=dhcp5
add address-pool=dhcp_pool6 authoritative=after-2sec-delay disabled=no interface=vlan22 name=dhcp6
8. Configure IP Address Lists
/ip firewall address-list
add address=10.10.10.0/24 list=TO-WAN1
add address=10.10.11.0/24 list=TO-WAN1
add address=10.10.12.0/24 list=TO-WAN1
add address=10.10.20.0/24 list=TO-WAN2
add address=10.10.21.0/24 list=TO-WAN2
add address=10.10.22.0/24 list=TO-WAN2
9. Configure Mark Routing
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=TO-WAN1 passthrough=yes src-address-list=TO-WAN1
add action=mark-routing chain=prerouting new-routing-mark=TO-WAN2 passthrough=yes src-address-list=TO-WAN2
10. Configure Static Route
/ip route
add check-gateway=ping distance=1 gateway=96.9.74.1 routing-mark=TO-WAN1
add check-gateway=ping distance=1 gateway=203.217.170.1 routing-mark=TO-WAN2
add check-gateway=ping distance=1 gateway=96.9.74.1
add check-gateway=ping distance=1 gateway=203.217.170.1
11. Configure NAT
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-WAN1
add action=masquerade chain=srcnat out-interface=ether2-WAN2
12. Add Port to Bridge-Vlan
/interface bridge port
add bridge=bridge-VLAN interface=ether3
add bridge=bridge-VLAN interface=ether4

2 comments: