Load Balance with Masquerade Network on RouterOS. Prepared by: Janis Megis (Mikrotik) Valens Riyadi (Citraweb)



Similar documents
MikroTik RouterOS Workshop Load Balancing Best Practice. Warsaw MUM Europe 2012

IP Flow Routing, Mangle and QoS

Load Balancing Using PCC & RouterOS

Bandwidth-based load-balancing with failover. The easy way. We need more bandwidth.

Load Balancing Using PCC & RouterOS

MikroTik Certified Network Associate (MTCNA) Training outline

MikroTik RouterOS Workshop QoS Best Practice. Prague MUM Czech Republic 2009

Building Effective Firewalls with MikroTik P R E S E N T E D B Y: R I C K F R E Y, N E T W O R K E N G I N E E R I P A R C H I T E C H S O P E R AT I

PowerLink Bandwidth Aggregation Redundant WAN Link and VPN Fail-Over Solutions

Smart Tips. Enabling WAN Load Balancing. Key Features. Network Diagram. Overview. Featured Products. WAN Failover. Enabling WAN Load Balancing Page 1

Linux Routers and Community Networks

» David Bisschoff» Durban, South Africa» Work at Kinsey Computers» Discovered MikroTik in Kinsey Computers cc

Copyright 2008 Link Technologies,Inc. A Proud Vendor Member of the

GregSowell.com. Mikrotik Security

How do I configure multi-wan in Routing Table mode?

Linux firewall. Need of firewall Single connection between network Allows restricted traffic between networks Denies un authorized users

Bandwidth Management and QOS

The Use of Mikrotik Router Boards With Radius Server for ISPs.

MULTI WAN TECHNICAL OVERVIEW

1.0 DHCPD.CONF. option domain-name-servers ; option domain-name "smuth-mru.org.zm"; option broadcast-address

TRUFFLE Broadband Bonding Network Appliance. A Frequently Asked Question on. Link Bonding vs. Load Balancing

WISP 101. The DO s and DON T s of becoming a Wireless ISP

TRUFFLE Broadband Bonding Network Appliance BBNA6401. A Frequently Asked Question on. Link Bonding vs. Load Balancing

1:1 NAT in ZeroShell. Requirements. Overview. Network Setup

LOHU 4951L Outdoor Wireless Access Point / Bridge

MikroTik RouterOS Introduction to MPLS. Prague MUM Czech Republic 2009

Corporate VPN Using Mikrotik Cloud Feature. By SOUMIL GUPTA BHAYA Mikortik Certified Trainer

10.4. Multiple Connections to the Internet

Burning Bridges - Routing Your Bridged WISP Network With MikroTik

Internet Protocol: IP packet headers. vendredi 18 octobre 13

How Your Computer Accesses the Internet through your Wi-Fi for Boats Router

Reducing the impact of DoS attacks with MikroTik RouterOS

IOS NAT Load Balancing with Optimized Edge Routing for Two Internet Connections

OSBRiDGE 5XLi. Configuration Manual. Firmware 3.10R

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Common VoIP problems, How to detect, correct and avoid them. Penny Tone LLC 1

PPTP Server Access Through The

1 Basic Configuration of Cisco 2600 Router. Basic Configuration Cisco 2600 Router

New Obvious and Obscure MikroTik RouterOS v5 features. Budapest, Hungary MUM Europe 2011

Troubleshooting and Maintaining Cisco IP Networks Volume 1

WAN Traffic Management with PowerLink Pro100

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Chapter 1 Connecting Your Router to the Internet

Evaluating Bandwidth Optimization Technologies: Bonded Internet

Load Balance Mechanism

MikroTik Invisible Tools. By : Haydar Fadel 2014

Basic IPv6 WAN and LAN Configuration

BroadCloud PBX Customer Minimum Requirements

NETWORK SETUP GLOSSARY

IOS NAT Load Balancing for Two ISP Connections

ASA/PIX: Load balancing between two ISP - options

IP addressing and forwarding Network layer

MPLS for ISPs PPPoE over VPLS. MPLS, VPLS, PPPoE

How To. Instreamer to Exstreamer connection. Project Name: Document Type: Document Revision: Instreamer to Exstreamer connection. How To 1.

MikroTik RouterOS v3. New Obvious and Obscure Mikrotik RouterOS v3.x features

How To Set Up A Pploe On A Pc Orca On A Ipad Orca (Networking) On A Macbook Orca 2.5 (Netware) On An Ipad 2.2 (Netrocessor

Introduction. Technology background

IP addressing. Interface: Connection between host, router and physical link. IP address: 32-bit identifier for host, router interface

Bandwidth Control. Table of Contents. General Information. Summary. Specifications

Controlling Network Traffic using MikroTik RouterOS

Chapter 1 Configuring Basic Connectivity

Quick Note 53. Ethernet to W-WAN failover with logical Ethernet interface.

ICS 351: Today's plan. IP addresses Network Address Translation Dynamic Host Configuration Protocol Small Office / Home Office configuration

Superior Disaster Recovery with Radware s Global Server Load Balancing (GSLB) Solution

Networking and High Availability

Common Application Guide

Configuring the Transparent or Routed Firewall

Chapter 4 Customizing Your Network Settings

CS Computer and Network Security: Firewalls

Chapter 2 Connecting the FVX538 to the Internet

Break Internet Bandwidth Limits Higher Speed. Extreme Reliability. Reduced Cost.

Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Network Architecture Validated designs utilizing MikroTik in the Data Center

Vocia MS-1 Network Considerations for VoIP. Vocia MS-1 and Network Port Configuration. VoIP Network Switch. Control Network Switch

Chapter 4 Customizing Your Network Settings

CS Computer and Network Security: Firewalls

Barracuda Link Balancer

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Low cost secure VPN MikroTik SSTP over OpenIXP (Indonesian Internet) ASTA INFORMATICS Faisal Reza

Sample Configuration Using the ip nat outside source static

Bell Aliant. Business Internet Border Gateway Protocol Policy and Features Guidelines

Configuring a customer owned router to function as a switch with Ultra TV

Internet Access Setup

Proxy Server, Network Address Translator, Firewall. Proxy Server

Internet Services. Amcom. Support & Troubleshooting Guide

Configuring IP Load Sharing in AOS Quick Configuration Guide

Network Security Exercise 10 How to build a wall of fire

LECTURE 4 NETWORK INFRASTRUCTURE

Quality of Service in wireless Point-to-Point Links

CSC574 - Computer and Network Security Module: Firewalls

Feature catalog. Q1-Q MikroTik RouterOS

Using VDOMs to host two FortiOS instances on a single FortiGate unit

Chapter 51 WAN Load Balancing

DSL-2600U. User Manual V 1.0

Multi-Homing Security Gateway

A Link Load Balancing Solution for Multi-Homed Networks

Load Balancing McAfee Web Gateway. Deployment Guide

netkit lab load balancer web switch 1.1 Giuseppe Di Battista, Massimo Rimondini Version Author(s)

MINIMUM NETWORK REQUIREMENTS 1. REQUIREMENTS SUMMARY... 1

Transcription:

Load Balance with Masquerade Network on RouterOS Prepared by: Janis Megis (Mikrotik) Valens Riyadi (Citraweb) Copyrights 2010

About Me Jānis Meģis, MikroTik Jānis (Tehnical, Trainer, NOT Sales) Support & Training Engineer for almost 6 years Specialization: QoS, PPP, Firewall, Routing Teaching MikroTik RouterOS classes since 2005 2

About Me Valens Riyadi - valens@mikrotik.co.id Company: Citraweb Nusa Infomedia Mikrotik Distributor (2002), Training Partner (2005) - www.mikrotik.co.id Wireless ISP - www.citra.net.id Web Developer - www.citra.web.id Head of National Internet Resources of Indonesian ISP Association / IDNIC Founder and Volunteer of Airputih Foundation, an IT Emergency Task Force on Disaster Area 3

Basic Concept Load Balance How to share traffic into 2 or more gateways Fail Over How to choose one link as primary link, and automatically swing to another link if the primary link fail 4

Load Balance Load Balancing is a technique to distribute workload across two or more network links in order to maximize throughput, minimize response time, and avoid overload Using multiple network links with load balancing, instead of a single network links, may increase reliability through redundancy 5

Load Balance 1 + 1 = 2 1 + 1 = 1 + 1 1 + 1 = ½ + ½ + ½ + ½ 1 + 1 = ¼ + ¼ + ¼ + ¼ + ¼ + ¼ + ¼ + ¼ The more users, more connections, the load balance will be more balance. 6

Load Balance The traffic distributed base on probability. We have to know how big is each link, and distributed traffic accordingly If we have 2 gateways A & B A has 1 mbps, and B has 2 mbps We will divide traffic to 3 flow, and send 1 flow to A, and 2 flows to B 7

RouterOS Features We need to use: Static route and policy route Firewall Mangle Firewall src-nat For more advanced setting, we can use also OSPF and BGP 8

Key of Load Balance UPLINK In simple network, we can choose which gateway we want to use for each uplink flow, using static route/policy route 9

Key of Load Balance DOWNLINK In natted network, we choose downlink gateway using src-nat/masq. Traffic will return from internet according to IP Address we use in NAT for each flow. In non natted network, we have to use BGP advertisement to control the routing from internet to our network. 10

Key Load Balance Traffic src-natted to IP Address located on gateway A, will return from internet through gateway A. If we use plain masquerade for each flow on all gateways, traffic will return from internet on the same gateway when leaving the network. 11

Static Route You can specify IP Address for the gateway in static route, if the interface is a static interface and has a static IP config. 12

Static Route For dynamic interface (ex: PPTP, PPPoE) you can choose interface as the gateway 13

Load Balance Method Static Route with Address List ECMP (equal cost multi path) NTH PCC BGP 14

Static Route Base on destination address Gateway A for internasional Gateway B for local/domestic traffic Using address-list of IP Address on domestic network/local internet exchange 15

Static Route Base on source address Client IP Address: 192.168.0.0/24 192.168.0.0-127 gateway A 192.168.0.128-255 gateway B 16

ECMP Equal Cost Multi Path The easiest way to do load balance for several gateways is using ECMP. ECMP will balance traffic to several gateways randomly 17

ECMP With 2 gateways with same capacity. 18

ECMP 2 gateway, capacity of gateway A is twice than gateway B 19

ECMP 3 gateway, gateway C is using gateway interface 20

ECMP Drawback As forwarding database is rebuilt every 10min in Linux Kernel, there is a chance that connection will jump to other gateway In case of masquerade this jump results in change of source address and in eventual disconnect More info at: http://www.enyo.de/fw/security/notes/linux-dst-cache-dos.html http://marc.info/?m=105217616607144 http://lkml.indiana.edu/hypermail/linux/net/0305.2/index.html#19 21

Configuration Setup 22

Basic Configuration 23

Policy Routing Policy routing is a method that allow to create separate routing polices for different traffic by creating custom routing tables In RouterOS these routing tables are created: For every table specified in /ip route rule For every routing-mark in mangle facility Marked traffic is automatically assigned to the proper routing table (no need for lookup rules) 24

Routing-mark RouterOS attribute assigned to each packet Routing-mark can be changed in firewall mangle facility just before any routing decision: chain Prerouting for all incoming traffic chain Output for outgoing traffic from router Every new routing mark have its own routing table with the same name By default all packets have main routing mark 25

Traffic to Connected Networks As connected routes are available only in main routing table, it is necessary that traffic to connected networks will stay in main routing table This will also allow proper communication between locally and remotely connected clients 26

Remote Connections In case when connection is initiated from public interface it is necessary to ensure that these connections will be replied via the same interface (from the same public IP) First we need to capture these connections (you can ether use default connection mark no-mark or connection state new here) 27

Custom Policy Routing Now we need to create a default route for every routing table (or else it will be resolved by main routing table) Lets create a jump rule to your custom policy routing here 28

Mark Routing Mark routing rules in mangle chain output will ensure that router itself is reachable via both public IP addresses Mark routing rules in mangle chain prerouting will ensure your desired load balancing 29

Mangle configuration 30

Custom Policy Routing There are no best way that we can suggest for load balancing you can either: Balance based on client IP address (address list) Balance based on traffic type (p2p, layer-7, protocol, port) Use automatic balancing (PCC) We do not suggest to use nth for policy routing of typical user traffic. 31

Per-address-pair Load Balancing In many situations communication between two hosts consist of more than one simultaneous connection. If those connections are taking different routing path they might have different latency, drop rate, fragmentation or source address (NAT) this way making multi-connection communications impossible. That is why instead of per-connection load balancing we should think about per-addresspair load balancing 32

Per Connection Classifier PCC is a firewall matcher that allows you to divide traffic into equal streams with ability to keep packets with specific set of options in one particular stream You can specify set of options from srcaddress, src-port, dst-address, dst-port More info at: http://wiki.mikrotik.com/wiki/pcc 33

PCC Configuration We just need to add 2 rules to our policy_routing chain to ensure automatic per-address-pair load balancing 34

Usual Problems Be careful about using no-mark connection mark if you have other mangle configuration in different chain ISP specified DNS servers might block request from non-isp public IPs, so we suggest to use public (ISP independent) DNS servers. If you would like to ensure fail-over enable check-gateway option in all default routes. 35

Thank you! Q&A Or email to: support@mikrotik.com valens@mikrotik.co.id 36